classification
Title: test_gdb has recently started failing
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: python-dev, vinay.sajip, vstinner
Priority: normal Keywords:

Created on 2012-01-02 23:19 by vinay.sajip, last changed 2012-01-05 11:46 by python-dev. This issue is now closed.

Messages (5)
msg150484 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2012-01-02 23:18
test_gdb has started failing recently on my Ubuntu Natty system:

vinay@eta-natty:~/tools/cpython$ ./python Lib/test/regrtest.py -v test_gdb
== CPython 3.3.0a0 (default:3ed5a6030c9b, Jan 2 2012, 23:04:11) [GCC 4.5.2]
==   Linux-2.6.38-13-generic-i686-with-debian-squeeze-sid little-endian
==   /home/vinay/tools/cpython/build/test_python_14449
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0)
[1/1] test_gdb

[successful tests snipped]

======================================================================
FAIL: test_print_after_up (test.test_gdb.PyPrintTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vinay/tools/cpython/Lib/test/test_gdb.py", line 670, in test_print_after_up
    r".*\nlocal 'c' = 3\nlocal 'b' = 2\nlocal 'a' = 1\n.*")
  File "/home/vinay/tools/cpython/Lib/test/test_gdb.py", line 171, in assertMultilineMatches
    self.fail(msg='%r did not match %r' % (actual, pattern))
AssertionError: 'Breakpoint 1 at 0x80ad5c6: file Python/bltinmodule.c, line 951.\n[Thread debugging using libthread_db enabled]\n\nBreakpoint 1, builtin_id (self=<module at remote 0xb7dd012c>, v=42) at Python/bltinmodule.c:951\n951\t    return PyLong_FromVoidPtr(v);\n#6 (unable to read python frame information)\nUnable to read information on python frame\nUnable to read information on python frame\nUnable to read information on python frame\n' did not match ".*\\nlocal 'c' = 3\\nlocal 'b' = 2\\nlocal 'a' = 1\\n.*"

======================================================================
FAIL: test_locals_after_up (test.test_gdb.PyLocalsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vinay/tools/cpython/Lib/test/test_gdb.py", line 702, in test_locals_after_up
    r".*\na = 1\nb = 2\nc = 3\n.*")
  File "/home/vinay/tools/cpython/Lib/test/test_gdb.py", line 171, in assertMultilineMatches
    self.fail(msg='%r did not match %r' % (actual, pattern))
AssertionError: 'Breakpoint 1 at 0x80ad5c6: file Python/bltinmodule.c, line 951.\n[Thread debugging using libthread_db enabled]\n\nBreakpoint 1, builtin_id (self=<module at remote 0xb7dd012c>, v=42) at Python/bltinmodule.c:951\n951\t    return PyLong_FromVoidPtr(v);\n#6 (unable to read python frame information)\nUnable to read information on python frame\n' did not match '.*\\na = 1\\nb = 2\\nc = 3\\n.*'

----------------------------------------------------------------------
Ran 42 tests in 13.809s

FAILED (failures=2, skipped=11)
test test_gdb failed
1 test failed:
    test_gdb

vinay@eta-natty:~/tools/cpython$ ./python
Python 3.3.0a0 (default:3ed5a6030c9b, Jan  2 2012, 23:04:11) 
[GCC 4.5.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sysconfig
>>> sysconfig.get_config_vars()['PY_CFLAGS']
'-Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes'
>>> 

vinay@eta-natty:~/tools/cpython$ gdb --version
GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.

vinay@eta-natty:~/tools/cpython$ gcc --version
gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

vinay@eta-natty:~/tools/cpython$ uname -a
Linux eta-natty 2.6.38-13-generic #53-Ubuntu SMP Mon Nov 28 19:23:39 UTC 2011 i686 i686 i386 GNU/Linux

Marking haypo as nosy since it might be related to recent changes for #13628.

In earlier tests (conducted on 12 Dec, before the #13628 fix was checked in) test_gdb did not fail on the same system.
msg150581 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2012-01-04 03:37
"test_gdb has started failing recently on my Ubuntu Natty system:
...
>>> sysconfig.get_config_vars()['PY_CFLAGS']
'-Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes'
...
Marking haypo as nosy since it might be related to recent changes for #13628."

Before my last change for #13628, test_gdb was skipped completly when Python was compiled in release mode (with gcc optimization, which is the default).

Except if you have an idea to improve python-gdb.py to make it find the frame pointer, the simple fix is to skip the failing tests if Python is optimized. I already add some @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") in my commit 0b03cb97dac0.

Would you like to write such patch?
msg150602 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-01-04 12:07
New changeset dfffb293f4b3 by Vinay Sajip in branch 'default':
Closes #13699. Skipped two tests if Python is optimised.
http://hg.python.org/cpython/rev/dfffb293f4b3
msg150640 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2012-01-05 00:32
> New changeset dfffb293f4b3 by Vinay Sajip in branch 'default'

The fix should also be applied to 3.2.
msg150667 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-01-05 11:46
New changeset a3d4cde1c357 by Vinay Sajip in branch '3.2':
Closes #13699. Skipped two tests if Python is optimised.
http://hg.python.org/cpython/rev/a3d4cde1c357

New changeset 7d87ebbbd718 by Vinay Sajip in branch 'default':
Closes #13699: merged fix from 3.2.
http://hg.python.org/cpython/rev/7d87ebbbd718
History
Date User Action Args
2012-01-05 11:46:47python-devsetstatus: open -> closed
resolution: fixed
messages: + msg150667
2012-01-05 00:32:56vstinnersetstatus: closed -> open
resolution: fixed -> (no value)
messages: + msg150640
2012-01-04 12:07:36python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg150602

resolution: fixed
stage: resolved
2012-01-04 03:37:27vstinnersetmessages: + msg150581
2012-01-02 23:19:00vinay.sajipcreate