-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
crashed caused by calling dlopen in find_library #55801
Comments
We probably should consider deprecating that. There is never a reason a user should be calling it before dlopen, as the user should just call dlopen instead. This function is from long before we had LazyLibrary and precompile such and we were experimenting with ways of making |
We use |
That is true, that usage is probably fine, but you might be better suited there to calling |
I think the underlying issue is that |
This may also be related: llvm/llvm-project#47565 However, that wouldn't explain why the simple C example program triggers the error. Only one version of LLVM is ever involved in that. |
The
find_library
function inlibdl.jl
makes two calls todlopen
while searching for a library. It has been discovered that this causes problems when looking for the ROCm librarylibamdhip64.so
on Fedora 40 Linux. ROCm links with LLVM, and callingdlopen
on it twice causes LLVM to crash and report some inconsistency in its settings:See this thread for where the problem shows up.
The problem is not specific to Julia. It can be reproduced in C by calling
dlopen
on the library, thendlcose
, thendlopen
again. See this post.My guess is that as called in
find_library
,dlopen
follwed bydlcose
leaves some state from the library in the process's working memory, and this state causes confusion whendlopen
is called on the library again.Can
find_library
be re-implemented so as not to actually calldlopen
anddlclose
on the file once it's been found?In general, programs will call
find_library
followed bydlopen
, so if it's possible forfind_library
to change the state of the process so that a call todlopen
afterward might see leftover state and crash, it makes sense to me thatfind_library
needs to be rewritten to not calldlopen
at all.The text was updated successfully, but these errors were encountered: