-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
Lookup libraries in libjulia-*
before jl_exe_handle
#50162
Conversation
We do not use `dlvsym` to separate the symbols between multiple copies of libjulia, instead preferring to resolve symbols directly against the appropriate internal library handle. During bootstrapping, many internal symbols (e.g. `jl_fl_parse`) are available in the global EXE namespace, so we need to adapt our search order to resolve symbols in internal libraries first. With this fix, no sysimage symbols are resolved to `jl_exe_handle` (which is generally broken in Julia-in-Julia scenarios): ``` $ cat objdump_after.txt | grep libjulia_internal_handle | wc 1131 14703 145899 $ cat objdump_after.txt | grep jl_exe_handle | wc 0 0 0 ``` versus before: ``` $ cat objdump_before.txt | grep libjulia_internal_handle | wc 577 7501 74433 $ cat objdump_before.txt | grep jl_exe_handle | wc 554 7202 63710 ```
This flag is needed to ensure that `libclang_rt.asan-*.so` appears explicitly in the DT_NEEDED entries of libjulia-*. Without this entry, e.g. `dlsym(libjulia_internal_handle)` can end up finding symbols directly in libc.so.6, effectively bypassing the ASAN interceptors.
85ba015
to
1af6648
Compare
In order for Due to #50170, I'm not able to test installation/relocatability with the new Makefile changes, but otherwise I think this is approximately the right approach. It works for me with |
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.
This looks right to me, but I haven't built it locally. As long as it works with the contrib scripts to build the ASAN Julia, I think we're good to go.
The reordering in |
During bootstrapping, many internal symbols (e.g.
jl_fl_parse
) are found in the global EXE namespace leading to an ambiguous lookup in Julia-in-Julia scenarios.With this search order change, no sysimage symbols are resolved to
jl_exe_handle
:versus before: