Commits on Source 1

  • cznic's avatar
    libc_netbsd.go: implement Xabort via SIG_DFL reset + raise · e45429f9
    cznic authored
    
    
    NetBSD's Xabort was a panic(todo()) stub, so C abort(3) terminated the process
    the wrong way: the Go runtime intercepts a delivered SIGABRT and exits with
    status 2 instead of dying by signal. SQLite's crash tests (writecrash.test) fork
    a child that abort()s and require it to be killed by SIGABRT; the stub made the
    child "exit abnormally" instead, failing writecrash-1.1.1 on netbsd/amd64.
    
    x/sys/unix exposes no high-level Sigaction on netbsd and Xsigaction is
    unimplemented here, so reset SIGABRT to SIG_DFL via the raw
    __sigaction_sigtramp(2) syscall (an all-zero struct sigaction = SIG_DFL;
    trampoline/version are unused for SIG_DFL), then raise SIGABRT so the kernel
    terminates the process by signal. ABI-preserving (Xabort signature unchanged).
    
    Validated on NetBSD 10.1/amd64: a child calling libc.Xabort is now killed by
    signal SIGABRT (exit 134), the behavior writecrash-1.1.1 expects.
    
    Co-Authored-By: default avatarClaude Opus 4.8 <noreply@anthropic.com>
    e45429f9
Loading
Loading