-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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] Optimized binary segfaults when using --use-old-text #89117
Comments
Can you please check which function contains the illegal instruction, and dump the function throughout BOLT's optimizations with |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Ok I had to use |
Btw the segfault occurs at |
As far as I can tell in the |
This replicates on 0dcabba. It seems in |
Ok so the issue seems to be that BOLT doesn't update the values in https://github.com/JuliaLang/julia/blob/7f8635f11cae5f3f592afcc7b55c8e0e23589c3d/src/flisp/opcodes.h#L39 so we end up jumping to the wrong place. Similarly it doesn't look like |
Thank you for finding the root cause. Please skip the function containing computed goto jump table with |
Thanks. If I don't use the old text flag is it fine to not skip it or might it still cause problems? |
Just to note, neither |
Even with |
Reproducer for llvm/llvm-project#89117.
I've created #89681 to prevent BOLT from producing corrupted binaries in such cases. |
Presumably, fixed by #89681. |
I'm using BOLT built from LLVM 18.1.4, I also see a segfault on 18.1.3 and 16.
I run
bolt libjulia-internal.so.1.12.0.original -o libjulia-internal.so.1.12.0 --use-old-text -no-huge-pages
(-no-huge-pages
is needed otherwise it doesn't use the old text). Here's the logI compiled with gcc with
-fno-reorder-blocks-and-partition
and-Wl,--emit-relocs
.Binaries are here if you want them (this was with the BOLT from LLVM 16).
If you want to reproduce the segfault on x86_64 linux you can download julia from the artifacts here https://buildkite.com/julialang/julia-master/builds/34942#018e6d3a-e24c-4bad-8406-6fbb670d9309. You can then BOLT the original binary or use the one I've already BOLTED here and replace
libjulia-internal.so.1.12.0
inlib/julia
with it. Then just runbin/julia
from the root directory.The text was updated successfully, but these errors were encountered: