Summary: Segfault on Array Append from Multiple Threads in GDC
                    and LDC:  Race Condition?
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P2
         Component: druntime

--- Comment #0 from David Simcha <> 2011-12-21 20:49:31 PST ---
import core.thread;

void main() {
    auto t = new Thread(&doIt);

void doIt() {
    while(1) {
        int[] arr1, arr2;
        double[] arr3;

        foreach(i; 0..10_000) {
            arr1 ~= 1;
            arr2 ~= 2;
            arr3 ~= 3;

This code segfaults on both GDC
and LDC (  It works on DMD or
of doIt() is only called from one thread.  

Since this is broken on both GDC and LDC it's worth having a bug report in the
main druntime database.  My gut feeling is that there's a concurrency bug
that's triggered by some compiler optimization that GDC and LDC do but DMD
doesn't do.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to