Hangs on toStringZ()

Nemanja Boric via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 28 04:39:46 PST 2016


On Wednesday, 28 December 2016 at 12:30:03 UTC, unDEFER wrote:
> On Wednesday, 28 December 2016 at 11:32:09 UTC, Nemanja Boric 
> wrote:
>> My other guess is that you're using D threads in your 
>> application?
>
> Of course I'm using D threads, but with it all is normally.

Right, nothing wrong with threads, but super tricky to combine it 
with fork. So, it could be that one of your threads is using GC 
at the point of the forking, so it keeps the GC locked. Now you 
fork, and _all your threads don't exist anymore, they are 
vanished, and if you don't do some clever stuff in atfork 
handler, there will be no cleanup_ - you just have copy of the 
thread that called fork. So, the thread that should release GC 
lock doesn't exist anymore, and there's nothing to release mutex, 
and it will stay locked forever in your forked process.


More information about the Digitalmars-d mailing list