-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Use libuv thread instead of std::thread to avoid musl issues #52149
Conversation
Make.inc
Outdated
@@ -1357,6 +1357,11 @@ endif | |||
JLIBLDFLAGS += -Wl,-z,noexecstack | |||
endif | |||
|
|||
#musl has a really small default stack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly speaking I think it's only Alpine Linux, but that probably covers vast majority of musl-based systems (and this option should hopefully be good in all other cases)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://git.musl-libc.org/cgit/musl/commit/?id=7b3348a98c139b4 Seems to a musl thing. Well the flag is a linker thing but it seems musl respects it since 2018
I suppose you have this all figured out and this changes "PT_GNU_STACK program header", in the ELF format. I was looking into what controls the stack size on different platforms, and that's it on also Musl, and thus seemingly all platforms, except Windows (and likely macOS): https://wiki.musl-libc.org/functional-differences-from-glibc.html
|
I thought we avoided using this code path in all cases, since libuv is already aware that musl's defaults are wrong (it usually will result in memory corruption if receiving any signals on any platforms since it is smaller than even a single a page) |
Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
See https://ariadne.space/2021/06/25/understanding-thread-stack-sizes-and-how-alpine-is-different/ and https://git.alpinelinux.org/aports/commit/?id=4ab6ef38f167f4983008f8b213e5beace8d453f0