-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-91960: skip test_gdb when built with clang #108993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
test_gdb should be skipped on all platforms when CPython is compiled with Clang, not only Darwin.
On second thought, #10318 (comment) says that clang itself is not the problem. Will do a bit more research. |
@@ -55,7 +55,7 @@ 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': | |||
if 'Clang' in platform.python_compiler(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it not make more sense to skip if Python is not built with GCC? Python can for example be built with icc
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of doubt, I prefer to not skip the test. Maybe icc is just fine.
Oh. I just realized that test_gdb failures on buildbots are specific to clang builders. There are many RHEL7, RHEL8, Fedora Stable and Fedora Rawhide. Half if using GCC, half is using clang. test_gdb only fails on clang builders. I dislike skipping a test without digging a little bit :-( How is clang so different than gcc? Is test_gdb failing with any clang optimization level, from Can we try to catch some gdb complains in gdb output to decide for the skip? I'm thinking at something similar to these existing skips: # bpo-40019: Skip the test if gdb failed to read debug information
# because the Python binary is optimized.
for pattern in (
'(frame information optimized out)',
'Unable to read information on python frame',
):
if pattern in out:
raise unittest.SkipTest(f"{pattern!r} found in gdb output") |
I just build Python with clang 16.0.6 (Fedora 16.0.6-2.fc38) on Fedora 38 using
With
test_gdb detects optimizations:
Do you see? test_gdb just pass. It would be always skip test_gdb knowning that 24 tests passed successfully on a total of 46 tests (22 tests were skipped). |
The 4 failing buildbots on the main branch. All of them are built with
|
On my Fedora 38 x86-64 with clang version 16.0.6 (Fedora 16.0.6-2.fc38), test_gdb fails if Python is built with
4 test_gdb tests are failing:
|
It seems like gdb is able to get the frame parameter of I think that we should focus on detecting gdb on Python build with
gdb is unable to get the frame argument of Comparison with Python built with
8 tests are skipped with GCC: 7 are skipped because of the
Logs:
Manual gdb test:
gdb is able to retrieve the frame parameter of |
Oh, I was on a very similar path at the same time :) I suspect it's a matter of debug information that gdb is able to find, rather than actually being optimized out. I also get gaps with lldb though, so the story might be a bit more complicated. Suggestion: we add the skip to unblock the FreeBSD CI build, and we open a new issue for the clang+gdb situation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always skipping is obvious the simplest approach, but I think that we can do better: I wrote PR #108999 to have a more precise test on when gdb is unable to retrieve the frame argument of _PyEval_EvalFrameDefault()
.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Thanks for putting the spot light on test_gdb :-) Your PR works obviously, but I chose to skip at the test function level, rather than skipping the whole module. See my tests: #108999 (comment) Many tests actually pass when Python is built with clang. Only "a few" tests fail depending on the clang optimization level which is not surprising, gcc+gdb has the same symptoms. I merged my PR #108999 instead. |
test_gdb should be skipped on all platforms when CPython is compiled with Clang, not only Darwin.