[New-bugs-announce] [issue43941] Unit test failure in test_gdb only with -O0

Larry Hastings report at bugs.python.org
Mon Apr 26 01:02:16 EDT 2021


New submission from Larry Hastings <larry at hastings.org>:

Recent Python source trees fail a regression test in test_gdb.  Oddly, the behavior only appears up when optimization is turned off.

To reproduce:

% git clone cpython buildtrunk
% cd buildtrunk
% ./configure
% vi Makefile  # change "-O3" to "-O0" !!
% make -j
% ./python -m test -v test_gdb

You'll be rewarded with one failure:

======================================================================
FAIL: test_wrapper_call (test.test_gdb.PyBtTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/larry/src/python/buildtrunk/Lib/test/test_gdb.py", line 947, in test_wrapper_call
    self.assertRegex(gdb_output,
AssertionError: Regex didn't match: "<method-wrapper u?'__init__' of MyList object at " not found in 'Breakpoint 1 at 0x281f5a: file Python/bltinmodule.c, line 1207.\n[Thread debugging using libthread_db enabled]\nUsing host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".\n\nBreakpoint 1, builtin_id (self=<cfunction_enter_call+35>, v=<unknown at remote 0x7fffffffc7b0>) at Python/bltinmodule.c:1207\n1207\t{\nBreakpoint 2: file Objects/descrobject.c, line 1386.\n\nBreakpoint 2, wrapper_call (wp=<unknown at remote 0x555555973820>, args=<unknown at remote 0x55555581dee8>, kwds=<unknown at remote 0x5555555bde85>) at Objects/descrobject.c:1386\n1386\t{\nTraceback (most recent call first):\n  <unknown at remote 0x555555973820>\n  File "<string>", line 4, in __init__\n  File "<string>", line 7, in <module>\n'

----------------------------------------------------------------------

I just reproduced this with version 3c4850e222388889426e250ff43308e4802dc582 .  Note that if you don't change the Makefile, and leave the optimization level at "-O3", you won't see this test failure.

Pablo, I nosied you just to get it on your radar.  Good luck with getting Python 3.10 over the finish line!

----------
components: Library (Lib)
keywords: 3.10regression
messages: 391878
nosy: larry, pablogsal
priority: normal
severity: normal
stage: needs patch
status: open
title: Unit test failure in test_gdb only with -O0
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43941>
_______________________________________


More information about the New-bugs-announce mailing list