[Issue 15939] GC.collect causes deadlock in multi-threaded environment

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Aug 9 11:12:44 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15939

--- Comment #19 from Martin Nowak <code at dawg.eu> ---
(In reply to Илья Ярошенко from comment #17)
> > https://github.com/dlang/druntime/pull/1110, that would affect dmd >=
> > 2.070.0.
> > Could someone test their code with 2.069.2?
> 
> Yes, the bug was found first for 2.069.

But that change is not in 2.069.x, only in 2.070.0 and following.
Can you somewhat reproduce it? Would simplify my life a lot.

Following my hypothesis, it should be fairly simple to trigger with one thread
continuously looping on GC.collect(), while concurrently spawning many short
lived threads, to increase the change of triggering the race between signal
delivery and the thread exiting.

If realtime signals are delivered faster (before pthread_kill returns), then
they might indeed avoid the race condition by pure chance.

--


More information about the Digitalmars-d-bugs mailing list