-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
[BOLT] llvm-bolt crashes during Python 3.13.1 build with addDebugFilenameToUnit segmentation fault #121213
Comments
Here is the related Python upstream bug report: python/cpython#124948 |
Could you please provide a reproducer step by step? |
@liusy58 Sure.
I haven't tried it with Clang-19.1, ideally you should use the version of Clang-20git that I used which comes with BOLT support (7226b39). I've used a custom compiled Clang-20git from that revision from these scripts: https://github.com/ms178/archpkgbuilds/tree/main/toolchain-experimental/llvm-bolt-scripts-master Just make these scripts executable with P.S: As BOLT is supported upstream via instrumentation with python 3.13.1, you can test both instrumenting BOLT with the upstream solution and sampling with the added patch. You just need to edit the PKGBUILD and hide the application of the patch with using |
Also please notice these changes on the Python side that are supposed to adress some of the BOLT issues: astral-sh/python-build-standalone#463 I haven't tested these yet as they are not included in an upstream release. This merge request for BOLT is also relevant: #120267 |
@ms178 Ok, Let me try to reproduce. Thank you~ |
Compiling python 3.13.1 with --enable-bolt on CachyOS with Clang-20git (7226b39) and the patch below yields the following crash.
Analysis:
llvm-bolt crashes with a segmentation fault during the optimization phase. The crash occurs in the llvm::bolt::BinaryContext::addDebugFilenameToUnit function, suggesting an issue related to handling debug information.
bolt.patch.txt
Flags used in
/etc/makepkg.conf
:BOLT_APPLY_FLAGS as found in the bolt.patch above:
BOLT_APPLY_FLAGS=" -update-debug-sections -reorder-blocks=ext-tsp -reorder-functions=cdsort -split-functions -icf=1 -inline-all -split-eh -reorder-functions-use-hot-size -peepholes=none -jump-tables=aggressive -inline-ap -indirect-call-promotion=all -dyno-stats -use-gnu-stack -frame-opt=hot -infer-stale-profile=1 -split-strategy=cdsplit --skip-funcs=sre_ucs1_match/1,_PyEval_EvalFrameDefault.localalias/1 "
The text was updated successfully, but these errors were encountered: