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-148284: Block inlining of gigantic functions in ceval.c for clang 22 by Fidget-Spinner · Pull Request #148334 · python/cpython Conversation
|
|
Tested with
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
So it seems whether the original bug reproduces on main or not is nondeterministic 😨 . However, I still believe this fix is right. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I built the Python main branch (without the fix) 3 times in a row from scratch ( I built the Python main branch on Fedora Rawhide (clang 22.1.3) with: On the two first builds, Script: import _testcapi import functools def py_call(): return _testcapi.stack_pointer() def call(): return py_call() start = _testcapi.stack_pointer() call = functools.partial(call) top = call() diff = start - top print("stack memory per call: %.1f kB" % (diff / 1024)) Output on the first two builds: Output on the third build: Note: I installed clang and its dependencies using |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
To get a more reproducible output, I tried using Using I built the Python main branch 3 times with these options and I got the same result each time: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ok, now testing the fix. I built Python with the fix 5 times in a row and
Commands: ./configure --enable-optimizations --with-lto --enable-shared CC=clang LD=clang time make -j14 LD_LIBRARY_PATH=$PWD ./python -m test -v test_call Result: test_call pass successfully and my script outputs Moreover, the C flags are set as expected in Makefile: |
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.
LGTM. The fix works as expected according to my manual tests (see above).
In general, I'm not fan of using a specific compiler option depending on the compiler veresion. In this case, I'm fine with it, it's a good trade-off.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @vstinner for the very thorough testing and review :). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @Fidget-Spinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…clang 22 (pythonGH-148334) (cherry picked from commit e007631) Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
|
GH-148349 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… clang 22 (GH-148334) (GH-148349) gh-148284: Block inlining of gigantic functions in ceval.c for clang 22 (GH-148334) (cherry picked from commit e007631) Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
|
Since the bug occurs randomly on clang 22 (coarse estimation 1/3 builds affected), I double checked clang 21. I built the Python main branch (without the fix) multiple times on Fedora Stable (clang 21.1.8): I failed to reproduce the issue. I confirm that the issue is specific to clang 22.
By the way, we do have Fedora Rawhide Clang buildbots (AArch64, AMD64, PPC64LE, s390x) with Clang 22.1.3, but they don't test the LTO+PGO case:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@vstinner if you want to test. 3.14 reliably crashes every single time I build with clang-22 before my patch was applied (ie at commit 429c1d3) You can try it out with clang-21 to see if it crashes. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I built the commit 429c1d3 wih clang 21 (Fedora Stable): I failed to reproduce the issue, test_call pass successfully and my script gives |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…clang 22 (pythonGH-148334) 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.