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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Apr 20 12:59:25 PDT 2016


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

--- Comment #6 from Aleksei Preobrazhenskii <apreobrazhensky at gmail.com> ---
I think I saw the same behaviour in debug builds, I will try to verify it. As
of 32-bit question, due to the nature of the program I can't test it in 32-bit
environment.

After investigating problem a little further, I think that the issue might be
in GC relying on traditional POSIX signals. One way to get such stack traces is
if suspend signal (SIGUSR1 by default) wasn't delivered, which could happen for
traditional POSIX signals if they occur in quick succession. Like, if
thread_suspendAll happens while some threads are still in the
thread_suspendHandler (already handled resume signal, but still didn't leave
the suspend handler).

Real-time POSIX signals (SIGRTMIN .. SIGRTMAX) have stronger delivery
guarantees, I'm going to try the same code but with
thread_setGCSignals(SIGRTMIN, SIGRTMIN + 1).

--


More information about the Digitalmars-d-bugs mailing list