https://issues.dlang.org/show_bug.cgi?id=20227
Rainer Schuetze <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Rainer Schuetze <[email protected]> --- > 1. GC creates worker threads > 2. Program forks, leaving the worker threads behind > 3. The GC keeps working, though, without any worker threads to read > from its queue, it does all the work in the main thread That's about what I expected to happen. If the parent process hasn't started any collection, the fork will create its own set of scan threads. > 4. On exit, the GC fails to destroy thread-related resources as > it is not aware that the program has forked. I didn't think of this. I wonder why the existing tests (e.g. in std.stdio) didn't fail, maybe because they didn't start any collection before forking. I guess what needs to happen is to reinitialize thread handles and used mutices in an atfork child handler. --
