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

          Issue ID: 21686
           Summary: segfault if daemon thread is killed, interrupts
                    syscall and throws exception
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: druntime
          Assignee: [email protected]
          Reporter: [email protected]

---
import core.thread;
import core.sys.linux.time : nanosleep, timespec, time_t;


void main()
{
    auto t = new Thread(&worker);
    t.isDaemon = true;
    t.start();
    Thread.sleep(1.seconds);
}

void worker()
{
    timespec s = timespec(time_t(10), 0);
    if (nanosleep(&s, null) != 0)
        throw new Exception("");
}
---
This segfaults for me with bt:
(gdb) bt
#0  0x000055f31a7b047e in
gc.impl.conservative.gc.SmallObjectPool.allocPage(ubyte) ()
#1  0x0000000000000000 in ?? ()

--

Reply via email to