deps: V8: cherry-pick ba4ef8d72cde

Original commit message:

    [platform][posix] Fallback to conservative stack limit on musl

    For most libcs, pthread_getattr_np() returns the the stack reserved
    limit on the main thread, but musl only returns the current high-water
    mark at the time of the call. There's no macro to detect musl, so just
    fallback to the conservative stack limit in cases where the libc is
    not one that is known to work.

    Refs: https://github.com/nodejs/node/pull/65161

    Change-Id: Ie2b51269b9e8d2d3451d5d68ad1a233d396af935
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8254825
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#109406}

Refs: https://github.com/v8/v8/commit/ba4ef8d72cdee9dd52d346e5309b7a82cffe3c8e
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65161
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
This commit is contained in:
Joyee Cheung authored and Antoine du Hamel committed 2026-10-04 22:38:40 +02:00
1 parent 30074a3cc8
commit 677424cd86
2 files changed
+9 -1

No files matched your search

+1 -1
View File
@@ -44,7 +44,7 @@
# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.9',
'v8_embedder_string': '-node.10',
##### V8 defaults for Node.js #####
+8
View File
@@ -1511,6 +1511,14 @@ Stack::StackSlot Stack::ObtainCurrentThreadStackReservedLimit() {
}
return stack.ss_sp;
#else
// For most libcs, pthread_getattr_np() returns the the stack reserved
// limit on the main thread, but musl only returns the current high-water
// mark at the time of the call. There's no macro to detect musl, so
// let the caller do a fallback in cases where the libc is not one that
// is known to work.
#if V8_OS_LINUX && !V8_LIBC_GLIBC && !V8_LIBC_BIONIC && !V8_LIBC_UCLIBC
if (syscall(__NR_gettid) == getpid()) return nullptr;
#endif
pthread_attr_t attr;
int error = pthread_getattr_np(pthread_self(), &attr);
if (error) {