www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20857] New: Rethrowing range error from thread with large

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

          Issue ID: 20857
           Summary: Rethrowing range error from thread with large stack
                    segfaults
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: dlang-bugzilla thecybershadow.net

///////////// test.d /////////////
import core.exception;
import core.thread;

void main()
{
    auto t = new Thread(delegate {
        int[] x;
        x[2] = 2;
    }, 64 * 1024 * 1024);
    t.start();
    t.join();
}
//////////////////////////////////

The RangeError should be rethrown, but the program simply segfaults.

Doesn't happen with a stack size of 32MB.

Introduced in https://github.com/dlang/druntime/pull/2395

--
May 23 2020