www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21686] New: segfault if daemon thread is killed, interrupts


          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: nobody puremagic.com
          Reporter: tobias pankrath.net

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

void main()
    auto t = new Thread(&worker);
    t.isDaemon = true;

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

gc.impl.conservative.gc.SmallObjectPool.allocPage(ubyte) ()

Mar 07 2021