mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-04 08:04:37 +08:00
Node sets SIGPIPE and SIGXFSZ to SIG_IGN at startup, so a write to a closed pipe or past RLIMIT_FSIZE fails with EPIPE or EFBIG, and libuv's spawns start children with every signal at its default action. The runtime instead blocked both signals in the writing thread. On Linux the signal a write raises goes to that thread, but on macOS it goes to the process, so a write to a closed pipe from the fs pool's threads ended the program with SIGPIPE. - scr_init ignores SIGPIPE and SIGXFSZ. A process.on listener replaces the disposition while it is registered, as before. - scr_fs_write_once writes directly in executables, and the fs pool's threads no longer block the two signals. Library builds keep the per-thread blocking, since their host owns the dispositions. - scr_spawn_command starts children with SIGPIPE and SIGXFSZ at their default actions (POSIX_SPAWN_SETSIGDEF), for spawnSync, execFileSync and spawn alike. write-signals-ignored.ts and write-signals-listener.mjs check the ignored signals, a listener, and each spawn path's child against Node.