You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
eval frame rename in pep 0523 broke gdb's python extension #75166
PEP-0523 renames PyEval_EvalFrameEx to _PyEval_EvalFrameDefault while the gdb python extension only looks for PyEval_EvalFrameEx to understand if it is dealing with a frame.
Final effect is that attaching gdb to a python3.6 process doesnt resolve python objects. Eg. py-list and py-bt dont work properly
changed the title [-]eval frame rename in pep 0523 broke gdp's python extension[/-][+]eval frame rename in pep 0523 broke gdb's python extension[/+]on Jul 21, 2017
======================================================================
FAIL: test_pyup_command (test.test_gdb.StackNavigationTests)
Verify that the "py-up" command works
----------------------------------------------------------------------
Traceback (most recent call last):
File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_gdb.py", line 688, in test_pyup_command$''')
File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_gdb.py", line 259, in assertMultilineMatchesself.fail(msg='%r did not match %r'% (actual, pattern))
AssertionError: 'Breakpoint 1 (builtin_id) pending.\n[Thread debugging using libthread_db enabled]\nUsing host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".\n\nBreakpoint 1, builtin_id (self=self@entry=, v=42) at Python/bltinmodule.c:1103\n1103\t{\n#4 Frame 0x4086b4cc, for file /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/gdb_sample.py, line 10, in baz (args=(1, 2, 3))\n id(42)\n#5 Frame 0x4086b4cc, for file /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/gdb_sample.py, line 10, in baz (args=(1, 2, 3))\n id(42)\n' did not match '^.*\n#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \\(a=1, b=2, c=3\\)\n baz\\(a, b, c\\)\n$'
I chose to revert the change because I don't have the bandwidth right now to investigate why the change broke test_gdb.
I'm surprised that a change affecting python-gdb.py wasn't properly tested manually using test_gdb.py :-( I understand that Travis CI doesn't have gdb and/or that the test pass in some cases?
The revert only gives us more time to design the proper solution.
In this case it would be great if the buildbots commented on the relevant pull request that it broke the build. Otherwise this creates this dissonance that it was all green during merging of the PR when in fact it wasn't.
I think we need to make test_gdb run on Travis, this is an unfortunate omission.
While our CI is getting better everyday, it still has a few flaws.
There is no automated buildbot failure notification to the author and
committer yet because random failures were very common 6 months ago. I
fixed something like 90% of the most common race conditions (in tests but
also in the code), and now the remaining 10% are the least funny ones :-)
My latest report: https://haypo.github.io/python-buildbots-2017q2.html
In the meanwhile I check manually buildbots output and report bugs and
regressions.
For gdb, don't worry, the buildbots were fixed quickly, it's fine if the
pre-commit CI missed the issue since gdb changes are rare. I am confident
that we can design a fix without introducing regressions ;-)
The issue originally stems from the fact that a non-debug Python build with --enable-shared is inlining PyEval_EvalFrameEx into _PyEval_EvalFrameDefault.
So, the patch should really become to *replace* discovering PyEval_EvalFrameEx with the discovery of _PyEval_EvalFrameDefault. This might be problematic in the future when there is an actual JIT but currently it's strictly better than the current situation where the gdb bindings simply don't work for shared builds.
Activity
bcap commentedon Jul 21, 2017
PEP-0523 renames PyEval_EvalFrameEx to _PyEval_EvalFrameDefault while the gdb python extension only looks for PyEval_EvalFrameEx to understand if it is dealing with a frame.
Final effect is that attaching gdb to a python3.6 process doesnt resolve python objects. Eg. py-list and py-bt dont work properly
[-]eval frame rename in pep 0523 broke gdp's python extension[/-][+]eval frame rename in pep 0523 broke gdb's python extension[/+]ambv commentedon Aug 14, 2017
New changeset 2e0f4db by Łukasz Langa (Bruno "Polaco" Penteado) in branch 'master':
bpo-30983: eval frame rename in PEP-0523 broke gdb's python extension (bpo-2803)
2e0f4db
ambv commentedon Aug 14, 2017
New changeset 09b7716 by Łukasz Langa in branch '3.6':
[3.6] bpo-30983: eval frame rename in PEP-0523 broke gdb's python extension (GH-2803) (bpo-3090)
09b7716
vstinner commentedon Aug 16, 2017
This change broke test_gdb on most buildbots :-(
http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/1159/steps/test/logs/stdio
======================================================================
FAIL: test_pyup_command (test.test_gdb.StackNavigationTests)
Verify that the "py-up" command works
----------------------------------------------------------------------
vstinner commentedon Aug 16, 2017
I chose to revert the change because I don't have the bandwidth right now to investigate why the change broke test_gdb.
I'm surprised that a change affecting python-gdb.py wasn't properly tested manually using test_gdb.py :-( I understand that Travis CI doesn't have gdb and/or that the test pass in some cases?
The revert only gives us more time to design the proper solution.
vstinner commentedon Aug 16, 2017
New changeset 7cc3399 by Victor Stinner in branch 'master':
bpo-30983: Revert changes which broke most buildbots (bpo-3100)
7cc3399
vstinner commentedon Aug 16, 2017
New changeset 98e2697 by Victor Stinner in branch '3.6':
Revert "[3.6] bpo-30983: eval frame rename in PEP-0523 broke gdb's python extension (GH-2803) (bpo-3090)" (bpo-3101)
98e2697
ambv commentedon Aug 17, 2017
In this case it would be great if the buildbots commented on the relevant pull request that it broke the build. Otherwise this creates this dissonance that it was all green during merging of the PR when in fact it wasn't.
I think we need to make test_gdb run on Travis, this is an unfortunate omission.
vstinner commentedon Aug 17, 2017
While our CI is getting better everyday, it still has a few flaws.
There is no automated buildbot failure notification to the author and
committer yet because random failures were very common 6 months ago. I
fixed something like 90% of the most common race conditions (in tests but
also in the code), and now the remaining 10% are the least funny ones :-)
My latest report:
https://haypo.github.io/python-buildbots-2017q2.html
In the meanwhile I check manually buildbots output and report bugs and
regressions.
For gdb, don't worry, the buildbots were fixed quickly, it's fine if the
pre-commit CI missed the issue since gdb changes are rare. I am confident
that we can design a fix without introducing regressions ;-)
ambv commentedon Aug 17, 2017
I am unable to repro this locally. With the changes to libpython.py test_gdb still passes on CentOS 7 and macOS 10.12.
ambv commentedon Aug 18, 2017
OK, I got the repro. You have to rebuild python for /Tools/gdb/libpython.py to land in /python-gdb.py. The latter is used during test_gdb.py.
vstinner commentedon Aug 18, 2017
Ah yes, sorry, that's not obvious. "make" does the copy for you.
ambv commentedon Aug 18, 2017
The issue originally stems from the fact that a non-debug Python build with --enable-shared is inlining PyEval_EvalFrameEx into _PyEval_EvalFrameDefault.
So, the patch should really become to *replace* discovering PyEval_EvalFrameEx with the discovery of _PyEval_EvalFrameDefault. This might be problematic in the future when there is an actual JIT but currently it's strictly better than the current situation where the gdb bindings simply don't work for shared builds.
ambv commentedon Aug 21, 2017
New changeset 5fe59f8 by Łukasz Langa in branch 'master':
bpo-30983: [gdb] Fix py-bt, etc. for non-debug shared builds (bpo-3153)
5fe59f8
ambv commentedon Aug 22, 2017
New changeset 8e57249 by Łukasz Langa in branch '3.6':
[3.6] bpo-30983: [gdb] Fix py-bt, etc. for non-debug shared builds (GH-3153) (bpo-3192)
8e57249