Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
darwin: use RLIMIT_STACK for fsevents pthread
This fixes `SIGBUS` crashes on macOS 10.15 due a new change in `FSEvents.framework` that makes it allocate a large stack array for event paths. (See the linked nodejs/node issue for details on the `FSEvents.framework` memory requirements change itself.) The existing size (`4 * PTHREAD_STACK_MIN` or 32KB) causes a stack overflow when more than ~1000 events are received at once. Setting this to `uv__thread_stack_size()` increases it to 8192KB (by default) on 64-bit machines. This value can be configured at runtime on macOS with `ulimit -s <size-kb>`. The 32KB limit was originally added to reduce virtual memory fragmentation on 32-bit systems, which is not a concern on 64-bit systems. Fixes: nodejs/node#37697 Refs: joyent/libuv#964 PR-URL: #3132 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
- Loading branch information