Can you reproduce this threading bug?

rikki cattermole rikki at cattermole.co.nz
Sat Jun 15 04:33:52 UTC 2019


On 15/06/2019 4:36 AM, FeepingCreature wrote:
> Consider the following code:
> 
> void main()
> {
>      import core.thread : Thread;
> 
>      with (new Thread({ })) { isDaemon = true; start; }
> }
> 
> On Linux, this builds and runs. Most of the time. Maybe 99% of the time.
> 
> But if you run it in a loop:
> 
> while true; do ./test || break; done
> 
> You may see that it segfaults after a few seconds. At least, it does for 
> me on 2.080.0, Linux 4.18.0-20 x86_64.
> 
> This is obviously quite bad. Any ideas?

Cannot reproduce under Windows 10 dmd 2.082.0 and ldc2 1.12.0-beta2.

But this does not say much, Windows has a different set of costs related 
to threads + processes. It was a good second between runs.


More information about the Digitalmars-d mailing list