Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs: use default stack size for fsevents pthread on macOS 10.15+ #37722

Closed
wants to merge 1 commit into from

Conversation

gluxon
Copy link
Contributor

@gluxon gluxon commented Mar 12, 2021

This fixes SIGBUS crashes on macOS 10.15 due to FSEvents code attempting to allocate large arrays on the stack.

The existing size (4 * PTHREAD_STACK_MIN or 32KB) causes a stack overflow when more than ~1000 events are received at once. See #37697 (comment) for a more detailed explanation. Removing the manual pthread_attr_setstacksize call here defaults to a stack size of 512KB.

A similar issue appeared in the past when Apple updated their FSEvents code on OS X 10.9 . joyent/libuv#964

This fixes `SIGBUS` crashes on macOS 10.15 due to FSEvents code
attempting to allocate large arrays on the stack.

The existing size (`4 * PTHREAD_STACK_MIN` or 32KB) causes a stack
overflow when more than ~1000 events are received at once.

Fixes: nodejs#37697
Refs: joyent/libuv#964
@nodejs-github-bot nodejs-github-bot added libuv Issues and PRs related to the libuv dependency or the uv binding. needs-ci PRs that need a full CI run. labels Mar 12, 2021
deps/uv/src/unix/fsevents.c Show resolved Hide resolved
deps/uv/src/unix/fsevents.c Show resolved Hide resolved
@mscdex
Copy link
Contributor

mscdex commented Mar 12, 2021

Changes to libuv need to be made upstream instead of here.

@gluxon
Copy link
Contributor Author

gluxon commented Mar 12, 2021

Changes to libuv need to be made upstream instead of here.

Ah, that makes sense. Thanks.

@gluxon
Copy link
Contributor Author

gluxon commented Mar 12, 2021

libuv/libuv#3132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libuv Issues and PRs related to the libuv dependency or the uv binding. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants