You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This hangs, but when running GOGC=off python test.py it works fine. Actually, calling runtime.GC() directly in the library causes a hang, suggesting that the garbage collector is responsible for hanging. Note that when using multiprocessing with Python, library function calls are put on a different thread from the one that initialized the Go package (init()).
What is causing the GC to hang? How can this be debugged?
The text was updated successfully, but these errors were encountered:
This seems to be an issue with forking a Go thread. Since Go launches an additional thread for the GC, when forking the main thread the other GC thread is not forked as well, causing it to hang when a forked thread tries to reach the GC thread of the original process. The solution is to not fork Go, but use the spawn strategy for example.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
See tdewolff/minify#535 for a bug report and how to reproduce. It concerns the Python binding for a library (https://github.com/tdewolff/minify/tree/master/bindings/py), which can be installed as
pip install tdewolff-minify
. Then runningpython test.py
wheretest.py
contains:This hangs, but when running
GOGC=off python test.py
it works fine. Actually, callingruntime.GC()
directly in the library causes a hang, suggesting that the garbage collector is responsible for hanging. Note that when using multiprocessing with Python, library function calls are put on a different thread from the one that initialized the Go package (init()
).What is causing the GC to hang? How can this be debugged?
The text was updated successfully, but these errors were encountered: