Comment #3 by safety0ff.bugz — 2016-12-29T20:06:03Z
Seems to be a race involving the global scheduler:
__gshared Scheduler scheduler;
@property ref ThreadInfo thisInfo() nothrow
{
1: if ( scheduler is null )
2: return ThreadInfo.thisInfo;
3: return scheduler.thisInfo;
}
If a thread sets scheduler to null after another has evaluated line 1 to false but hasn't run line 3,
then the other thread tries to run scheduler.thisInfo with a null scheduler.
I'm not sure what the design is for the global scheduler is with regard to concurrent access.
I.e. I'm wondering if all the `scheduler is null` checks be changed to:
auto lscheduler = atomicLoad(scheduler);
if (lscheduler is null)
return ...;
lscheduler. ... //
Comment #4 by safety0ff.bugz — 2016-12-29T21:49:05Z
In the last two months I havn't seen this in the results of the test suite. Is it still there?
Comment #7 by bugzilla — 2021-02-20T19:49:25Z
Running "make -f posix.mak -j3 style" on my local computer I got this today:
double free or corruption (out)
Error: program killed by signal 6
make: *** [posix.mak:651: std/concurrency.publictests] Fehler 1
Comment #8 by bugzilla — 2021-07-26T01:17:42Z
Still seeing it in FreeBSD running the Phobos test suite:
FreeBSD 11.4 x64, DMD (bootstrap) Failing after 11m — Task Summary
make[1]: *** [posix.mak:412: unittest/std/concurrency.run] Segmentation fault (core dumped)
Comment #9 by dlang-bot — 2021-10-16T10:35:14Z
@WalterWaldron updated dlang/phobos pull request #5004 "Fix issue 17037 - std.concurrency has random segfaults" fixing this issue:
- Fix issue 17037 - std.concurrency has random segfaults
https://github.com/dlang/phobos/pull/5004
Comment #10 by dlang-bot — 2021-10-19T13:29:55Z
dlang/phobos pull request #5004 "Fix issue 17037 - std.concurrency has random segfaults" was merged into master:
- 2c6051da1023f535544de5f575c013803286f62c by WalterW:
Fix issue 17037 - std.concurrency has random segfaults
https://github.com/dlang/phobos/pull/5004