-
Notifications
You must be signed in to change notification settings - Fork 900
dlopen, dlclose libmpi triggers a segmentation fault if calling getenv #10142
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
Comments
I can also confirm this on Archlinux with OpenMPI 4.1.2 |
As a workaround, try to
before running your program. |
@vchuravy did you adapt the path to |
@vchuravy and you probably did ... @simonbyrne note you can reproduce the crash by using feel free to refer to open-mpi/hwloc@fe363de for the gory details. |
Indeed I can, thanks! And your suggested fix works. Will your patch make it into a release soon? |
I am not the author of that patch. @bgoglin any plan to release |
The fix is actually in hwloc, not Open MPI. Open MPI embeds a copy of hwloc (which, for the purposes of this discussion, is just a library), but that embedded copy of hwloc is only used if hwloc is not already available on your system. The version of hwloc that is included in Open MPI v4.1.2 is hwloc v2.0.2, which is long before the |
FWIW: I see the fix in hwloc v2.7.0, which appears to both be the latest version available, and also what homebrew pulled down and installed for me this morning. EDIT: This ^^ turned out to be incorrect. See #10142 (comment), below. |
I wonder why I don't receive notification from github anymore when I am tagged. |
@jsquyres you meant the |
@ggouaillardet You are absolutely right. Thanks for the correction! |
hwloc 2.7.1rc1 is available from https://www.open-mpi.org/software/hwloc/v2.7/ |
I did a local build of 2.7.1rc1 and I can confirm that with this one dlclosing libhwloc doesn't segfault badly: julia> using Hwloc_jll, Libdl
[ Info: Precompiling Hwloc_jll [e33a78d0-f292-5ffc-b300-72abe9b543c8]
julia> dlclose(Hwloc_jll.libhwloc_handle)
true For reference, at the moment with 2.7.0 I get julia> using Hwloc_jll, Libdl
julia> dlclose(Hwloc_jll.libhwloc_handle)
signal (11): Segmentation fault
in expression starting at none:0
getenv at /usr/bin/../lib/libc.so.6 (unknown line)
[...] Thanks! |
Thanks @bgoglin! |
Thanks a lot for testing so quickly, I just released the final hwloc 2.7.1 then. |
This pulls in a fix for a segv when doing a sequence of dlopen(libmpi) + dlocose() + getenv(). See open-mpi#10142 for more details. Signed-off-by: Austen Lauria <[email protected]>
This pulls in a fix for a segv when doing a sequence of dlopen(libmpi) + dlocose() + getenv(). See open-mpi#10142 for more details. Signed-off-by: Austen Lauria <[email protected]> (cherry picked from commit 1b4379e)
PR's merged. Closing as fixed in upstream HWLOC and now in internal HWLOC ompi builds. |
Background information
What version of Open MPI are you using? (e.g., v3.0.5, v4.0.2, git branch name and hash, etc.)
4.1.2
Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)
Using homebrew.
If you are building/installing from a git clone, please copy-n-paste the output from
git submodule status
.Please describe the system on which you are running
Details of the problem
Doing the following:
dlopen
libmpidlclose
itgetenv
on an unset environment variabletriggers a segmentation fault
cc: @vchuravy
The text was updated successfully, but these errors were encountered: