mirror of
https://codeberg.org/ziglang/zig
synced 2026-11-18 07:05:05 +00:00
As the comment explains, if a signal were to arrive between a detached thread's `munmap` and `exit` calls, the signal handler would immediately trigger SIGSEGV due to the stack being unmapped. To solve this, we need to block all signals before entering this logic. The musl implementation which this logic was ported from does this exact thing; that logic was just lost when porting. Notably, this would lead to a crash with no stack trace, because the SIGSEGV handler would itself crash due to the missing stack.
1919 lines
69 KiB
1919 lines
69 KiB