forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work around dlopen not working properly under sanitizer instrumentati…
…on (JuliaLang#46255) `dlopen` has a mis-feature where it looks at the return address to determine the calling object to look at it's RUNPATH. Because asan intercepts `dlopen`, the calling object check finds asan rather than julia, causing an incorrect RUNPATH (and other flags to be used). Arguably, this is mostly a libc problem, because there isn't really a way to directly specify the resolution scope. I have sent a proposal to libc-coord [1] to fix this, but of course, we can't wait for that to percolate down to us. Instead, this takes advantage of the fact that almost all of our dlopen calls go through a single entrypoint in jl_dlopen, so we can insert additional logic here to make this work. This doesn't catch uses of `dlopen` in jlls (which is a problem for things like plugin loading in various jlls), but it at least makes base julia work. We can punt the jll question to another day - either with a patched libc in PkgEval or by patching the jll source with an analogous patch. Regardless, with this, Julia bootstraps properly under asan, without any special LD_LIBRARY_PATH hacks. [1] https://www.openwall.com/lists/libc-coord/2022/08/04/1
- Loading branch information
Showing
2 changed files
with
102 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters