-
Notifications
You must be signed in to change notification settings - Fork 133
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
Using dlopen on libnglib.so crashes in std::map #201
Comments
After investigation this crash is not specific to
After a few tests with various flags, I do not think it is not a single one, but a combination of these that I could not determine. |
Classic initilization order problem. The |
A std::map is in an invalid state when just zero-initialized, and needs to be initialized by its constructor. As this initilization may be done after the first call to Register, a crash will typically happen. To fix this wrap all accesses to the map with a Meyers Singleton. Also remove the extra Array - most accesses are using the key, and the few format list iterations all sort the result afterwards anyway. Fixes NGSolve#201.
Version v6.2.2404, from openSUSE Tumbleweed.
Here's a weird one.
Using
dlopen
onlibnglib.so
will cause a crash during the static initialization of global variable below in rw_medit.cpp:Here's the gdb stack trace:
It was generated from execution this simple program that is segfaulting in dlopen:
I tried to understand what could cause it but failed.
I tried a minimal C++ shared lib mimicking what is done in
writeuser.hpp/writeuser.cpp
but it did not crash.Quite puzling this one. If that helps, I attached the compilation log of netgen:
netgen_build_log.txt
The text was updated successfully, but these errors were encountered: