Open butterunderflow opened 2 weeks ago
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?
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. I think, if you want to perform the GC initialization implicitly, you should compile bdwgc with -Denable_threads_discovery=ON and remove GC_init and GC_allow_register_threads() calls.
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: