This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.7 and 3.x
Type: Stage: resolved
Components: Tests Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: koobs, pablogsal, vstinner
Priority: normal Keywords:

Created on 2019-03-04 14:09 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (11)
msg337119 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-03-04 14:09
test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.x failed.

Can it be related to my revert, commit 4d61e6e3b802399be62a521d6fa785698cb670b5?

https://buildbot.python.org/all/#/builders/168/builds/676

FAIL: test_corrupt_tp_flags (test.test_gdb.PrettyPrintTests)
FAIL: test_corrupt_tp_name (test.test_gdb.PrettyPrintTests)
FAIL: test_dicts (test.test_gdb.PrettyPrintTests)
FAIL: test_exceptions (test.test_gdb.PrettyPrintTests)
FAIL: test_frames (test.test_gdb.PrettyPrintTests)
FAIL: test_frozensets (test.test_gdb.PrettyPrintTests)
FAIL: test_getting_backtrace (test.test_gdb.PrettyPrintTests)
FAIL: test_int (test.test_gdb.PrettyPrintTests)
FAIL: test_lists (test.test_gdb.PrettyPrintTests)
FAIL: test_modern_class (test.test_gdb.PrettyPrintTests)
FAIL: test_selfreferential_dict (test.test_gdb.PrettyPrintTests)
FAIL: test_selfreferential_list (test.test_gdb.PrettyPrintTests)
FAIL: test_selfreferential_new_style_instance (test.test_gdb.PrettyPrintTests)
FAIL: test_selfreferential_old_style_instance (test.test_gdb.PrettyPrintTests)
FAIL: test_sets (test.test_gdb.PrettyPrintTests)
FAIL: test_singletons (test.test_gdb.PrettyPrintTests)
FAIL: test_strings (test.test_gdb.PrettyPrintTests)
FAIL: test_subclassing_list (test.test_gdb.PrettyPrintTests)
FAIL: test_subclassing_tuple (test.test_gdb.PrettyPrintTests)
FAIL: test_truncation (test.test_gdb.PrettyPrintTests)
FAIL: test_tuples (test.test_gdb.PrettyPrintTests)
FAIL: test_basic_command (test.test_gdb.PyListTests)
FAIL: test_one_abs_arg (test.test_gdb.PyListTests)
FAIL: test_two_abs_args (test.test_gdb.PyListTests)
FAIL: test_down_at_bottom (test.test_gdb.StackNavigationTests)
FAIL: test_pyup_command (test.test_gdb.StackNavigationTests)
FAIL: test_up_at_top (test.test_gdb.StackNavigationTests)
FAIL: test_up_then_down (test.test_gdb.StackNavigationTests)
FAIL: test_bt (test.test_gdb.PyBtTests)
FAIL: test_bt_full (test.test_gdb.PyBtTests)
FAIL: test_gc (test.test_gdb.PyBtTests)
FAIL: test_pycfunction (test.test_gdb.PyBtTests)
FAIL: test_threads (test.test_gdb.PyBtTests)
FAIL: test_wrapper_call (test.test_gdb.PyBtTests)
FAIL: test_basic_command (test.test_gdb.PyPrintTests)
FAIL: test_print_after_up (test.test_gdb.PyPrintTests)
FAIL: test_printing_builtin (test.test_gdb.PyPrintTests)
FAIL: test_printing_global (test.test_gdb.PyPrintTests)
FAIL: test_basic_command (test.test_gdb.PyLocalsTests)
FAIL: test_locals_after_up (test.test_gdb.PyLocalsTests)

Example:

======================================================================
FAIL: test_NULL_ob_type (test.test_gdb.PrettyPrintTests)
Ensure that a PyObject* with NULL ob_type is handled gracefully
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_gdb.py", line 533, in test_NULL_ob_type
    self.assertSane('id(42)',
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_gdb.py", line 504, in assertSane
    self.get_gdb_repr(source,
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_gdb.py", line 269, in get_gdb_repr
    gdb_output = self.get_stack_trace(source, breakpoint=BREAKPOINT_FN,
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_gdb.py", line 249, in get_stack_trace
    self.assertEqual(unexpected_errlines, [])
AssertionError: Lists differ: ['Error: ', 'During startup program exited[62 chars]ck.'] != []

First list contains 4 additional elements.
First extra element 0:
'Error: '

+ []
- ['Error: ',
-  'During startup program exited with code 127.',
-  'No symbol "v" in current context.',
-  'No stack.']
msg337121 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-03-04 14:25
> https://buildbot.python.org/all/#/builders/168/builds/676

Extract of pythoninfo:

gdb_version: GNU gdb (GDB) 8.2.1 [GDB v8.2.1 for FreeBSD]
sys.thread_info: sys.thread_info(name='pthread', lock='semaphore', version=None)

I'm unable to reproduce the issue on my FreeBSD 12 VM. But on my VM... I get a different issue: bpo-36184 "test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD".
msg337126 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-03-04 15:02
I tested gdb on the buildbot and I got permission errors, at least under my user "haypo":

warning: Could not trace the inferior process.
Error: 
warning: ptrace: Operation not permitted


Logs:

CURRENT-amd64% gdb -args ./python Lib/test/gdb_sample.py
GNU gdb (GDB) 8.2.1 [GDB v8.2.1 for FreeBSD]
(...)
warning: File "/usr/home/haypo/cpython/python-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:~/prog/".
To enable execution of this file add
	add-auto-load-safe-path /usr/home/haypo/cpython/python-gdb.py
line to your configuration file "/home/haypo/.gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/home/haypo/.gdbinit".

(...)

(gdb) b builtin_id
Breakpoint 1 at 0x451264: file Python/bltinmodule.c, line 1203.

(gdb) run
Starting program: /usr/home/haypo/cpython/python Lib/test/gdb_sample.py
warning: Could not trace the inferior process.
Error: 
warning: ptrace: Operation not permitted
msg337127 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-03-04 15:05
On my FreeBSD 12.0 VM, "py-bt" works as expected. It might be a recent change in FreeBSD CURRENT kernel?
msg337134 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-03-04 15:47
Same errors on AMD64 FreeBSD CURRENT Shared 3.7:
https://buildbot.python.org/all/#/builders/173/builds/333
msg337154 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-03-04 22:14
Koobs recently installed gdb on the buildbot to debug some of the recent race conditions. This is very likely to have caused some problems with the test suite.
msg337155 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-03-04 22:18
I think the solution here is uninstalling gdb from the buildbot. I have emailed Kubilay to see if he can revert the gdb installation to check if this is what is causing the problems.
msg337157 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-03-04 22:43
> I think the solution here is uninstalling gdb from the buildbot. I have emailed Kubilay to see if he can revert the gdb installation to check if this is what is causing the problems.

Well, test_gdb should work on FreeBSD :-) If you and koobs prefer to remove gdb, I'm also fine with that.
msg337162 - (view) Author: Kubilay Kocak (koobs) (Python triager) Date: 2019-03-05 01:30
Pablo asked for gdb to be installed to debug the crash in bug issue 36114 and I let him know in my email reply that when I had installed gdb in the past for an unrelated debug need, that test_gdb failed, which at the time I didn't have the time/cycles to report.

I too would prefer that test_gdb didn't fail with gdb installed, but am happy to remove it in the *short term* if requested, once crash analysis for issue 36114 is complete.
msg337163 - (view) Author: Kubilay Kocak (koobs) (Python triager) Date: 2019-03-05 01:33
I've just removed gdb from the buildbot at Pablo's (email) request. I can reinstall it on request at any time to resolve the test_gdb failures tracked in this issue.
msg337181 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-03-05 11:31
Since test_gdb only failed on your buildbot, I close the issue.

As I wrote, I'm unable to reproduce the issue on my FreeBSD 12 VM. It's not easy to debug if I don't have a full access (root user) to the issue. Moreover, honestly, I'm not really excited to debug this issue :-)
History
Date User Action Args
2022-04-11 14:59:12adminsetgithub: 80364
2019-03-05 11:31:32vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg337181

stage: resolved
2019-03-05 01:33:56koobssetmessages: + msg337163
2019-03-05 01:30:50koobssetmessages: + msg337162
2019-03-04 22:43:49vstinnersetmessages: + msg337157
2019-03-04 22:18:20pablogsalsetmessages: + msg337155
2019-03-04 22:14:10pablogsalsetmessages: + msg337154
2019-03-04 15:47:45vstinnersetmessages: + msg337134
title: test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.x -> test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.7 and 3.x
2019-03-04 15:29:53vstinnersettitle: test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.x failed -> test_gdb failed on AMD64 FreeBSD CURRENT Shared 3.x
2019-03-04 15:05:29vstinnersetmessages: + msg337127
2019-03-04 15:02:58vstinnersetnosy: + koobs
messages: + msg337126
2019-03-04 14:25:22vstinnersetmessages: + msg337121
2019-03-04 14:09:25vstinnercreate