-
Notifications
You must be signed in to change notification settings - Fork 406
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
GC_allow_register_threads get stuck when it's called implicitly when DLL is loaded (on Windows) #659
Comments
I created a repository to reproduce the behavior in this issue. I hope that will illustrate my question more clear. https://github.com/butterunderflow/bdwgc-issue-659-reproduce |
Is this reproduced on bdwgc master? |
I just tried on the latest master, the program still stuck at dll loading. |
Would anyone help me verify if this is a bug or if some configuration of mine is wrong? |
As mentioned in win32_threads.c, code invoked from a dll initializer should be lock-free, but code of GC_allow_register_threads() is not. |
GC_allow_register_threads
get stuck when it's in a shared library (on Windows)
Recently, I try to make bdwgc get initialized when I load a library, so I wrote these code in my shared library
test.cpp
:and compile it to a dll library like this(the
bdwgc/build/libgc.dll
is compiled by cmake toolchain):But unfortunately, when I load this library from my main executable
main.cpp
:it get stuck:
Then I enter gdb, it shows some information now, but the process still hangs, which looks like a dead lock:
Any help or suggestion is appreciated!
PS
The build configuration of bdwgc:
cmake -B build -Denable_disclaim=ON -Denable_atomic_uncollectable=ON -Denable_java_finalization=ON -Denable_mmap=ON -Denable_munmap=ON -Denable_threads=ON -Denable_parallel_mark=ON -Denable_thread_local_alloc=ON -DCMAKE_USE_WIN32_THREADS_INIT=true -G "MinGW Makefiles"
The text was updated successfully, but these errors were encountered: