GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — gh-91960: Skip test_gdb if gdb cannot retrive Python frames by vstinner · Pull Request #108999 · python/cpython Conversation
|
|
Without my PR, test on FreeBSD 13.2 with clang version 14.0.5: FAILURE
Tests with my PR. Linux, clang 16Test on Linux, Fedora 38 with clang version 16.0.6 (Fedora 16.0.6-2.fc38):
FreeBSD, clang 14Test on FreeBSD 13.2 with clang version 14.0.5:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Skip test_gdb if gdb is unable to retrieve Python frame objects: if a frame is "<optimized out>". When Python is built with "clang -Og", gdb can fail to retrive the 'frame' parameter of _PyEval_EvalFrameDefault(). In this case, tests like py_bt() are likely to fail. Without getting access to Python frames, python-gdb.py is mostly clueless on retrieving the Python traceback. Moreover, test_gdb is no longer skipped on macOS if Python is built with Clang.
542c061 to
66a5f76
Compare
|
UPDATE: Moreover, test_gdb is no longer skipped on macOS if Python is built with Clang. diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index c05a2d387c..ca50574e46 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -55,10 +55,6 @@ def get_gdb_version(): if not sysconfig.is_python_build(): raise unittest.SkipTest("test_gdb only works on source builds at the moment.") -if 'Clang' in platform.python_compiler() and sys.platform == 'darwin': - raise unittest.SkipTest("test_gdb doesn't work correctly when python is" - " built with LLVM clang") - if ((sysconfig.get_config_var('PGO_PROF_USE_FLAG') or 'xxx') in (sysconfig.get_config_var('PY_CORE_CFLAGS') or '')): |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Test with my PR and Test on Linux: SUCCESS with only 18 skipped tests on 46, nice!
Test on FreeBSD: SUCCESS with only 18 skipped tests on 46, nice!
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Now I have doubts about my tests on Linux :-( I'm not sure that I passed CC=clang to configure! I redone my tests on Linux:
Oh ok, we are safe :-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GitHub Action jobs:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Clang just treats |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| 'Unable to read information on python frame', | ||
| # gh-91960: On Python built with "clang -Og", gdb gets | ||
| # "frame=<optimized out>" for _PyEval_EvalFrameDefault() parameter | ||
| '(unable to read python frame information)', |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Any idea why libpython.py prints this rather than "Unable to read information on python frame"? It's possible that there are just some spots that you missed back in #19081
I'm also afraid that this speaks of a fragility of this approach. When optimizations are enabled, it's not easy to predict exactly what is going to be missing. But I'm happy that this allows to re-enable tests on platforms that were entirely ignored.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Any idea why libpython.py prints this rather than "Unable to read information on python frame"? It's possible that there are just some spots that you missed back in #19081
It's likely possible to unify python-gdb.py logs, or use a different regex to match both cases :-) The (unable to read ...) format is for py-bt command. Depending on the command, the log is displayed differently. I took the lazy way of just matching the two strings.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…thonGH-108999) Skip test_gdb if gdb is unable to retrieve Python frame objects: if a frame is "<optimized out>". When Python is built with "clang -Og", gdb can fail to retrive the 'frame' parameter of _PyEval_EvalFrameDefault(). In this case, tests like py_bt() are likely to fail. Without getting access to Python frames, python-gdb.py is mostly clueless on retrieving the Python traceback. Moreover, test_gdb is no longer skipped on macOS if Python is built with Clang. (cherry picked from commit fbce43a) Co-authored-by: Victor Stinner <[email protected]>
|
GH-109010 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…thonGH-108999) Skip test_gdb if gdb is unable to retrieve Python frame objects: if a frame is "<optimized out>". When Python is built with "clang -Og", gdb can fail to retrive the 'frame' parameter of _PyEval_EvalFrameDefault(). In this case, tests like py_bt() are likely to fail. Without getting access to Python frames, python-gdb.py is mostly clueless on retrieving the Python traceback. Moreover, test_gdb is no longer skipped on macOS if Python is built with Clang. (cherry picked from commit fbce43a) Co-authored-by: Victor Stinner <[email protected]>
|
GH-109011 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…H-108999) (#109011) gh-91960: Skip test_gdb if gdb cannot retrive Python frames (GH-108999) Skip test_gdb if gdb is unable to retrieve Python frame objects: if a frame is "<optimized out>". When Python is built with "clang -Og", gdb can fail to retrive the 'frame' parameter of _PyEval_EvalFrameDefault(). In this case, tests like py_bt() are likely to fail. Without getting access to Python frames, python-gdb.py is mostly clueless on retrieving the Python traceback. Moreover, test_gdb is no longer skipped on macOS if Python is built with Clang. (cherry picked from commit fbce43a) Co-authored-by: Victor Stinner <[email protected]>
|
Sadly, this change wasn't enough to fix PPC64LE Fedora Stable Clang 3.x: I created issue #109053. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…H-108999) (#109010) gh-91960: Skip test_gdb if gdb cannot retrive Python frames (GH-108999) Skip test_gdb if gdb is unable to retrieve Python frame objects: if a frame is "<optimized out>". When Python is built with "clang -Og", gdb can fail to retrive the 'frame' parameter of _PyEval_EvalFrameDefault(). In this case, tests like py_bt() are likely to fail. Without getting access to Python frames, python-gdb.py is mostly clueless on retrieving the Python traceback. Moreover, test_gdb is no longer skipped on macOS if Python is built with Clang. (cherry picked from commit fbce43a) Co-authored-by: Victor Stinner <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.