Skip to content

Disable madvise(MADV_DONTFORK) #54

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

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libexec/extract-node
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ cd "${src}/node-v${version}"
#patch -p1 < "${top}"/patch/gyp-libv8_monolith.patch
#patch -p1 < "${top}"/patch/py2-icutrim.patch
#patch -p1 < "${top}"/patch/py2-genv8constants.patch
patch -p1 < "${top}"/patch/v8-disable-madv-dontfork.patch
patch -p1 < "${top}"/patch/v8-disable-pkey.patch

# TODO: the following still fails on py3 so the above one forcing py2 is needed
Expand Down
16 changes: 16 additions & 0 deletions patch/v8-disable-madv-dontfork.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/tools/v8_gypfiles/features.gypi b/tools/v8_gypfiles/features.gypi
index 6e21dac6d7..bcf022fb28 100644
--- a/tools/v8_gypfiles/features.gypi
+++ b/tools/v8_gypfiles/features.gypi
@@ -73,7 +73,10 @@
}, {
'v8_enable_etw_stack_walking': 0,
}],
- ['OS=="linux"', {
+ # Disable madvise(MADV_DONTFORK), it's a great optimization for programs
+ # that fork & exec but not for programs that fork and keep running.
+ # It makes mini_racer's test/test_forking.rb test segfault.
+ ['False and OS=="linux"', {
# Sets -dV8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION.
#
# This flag speeds up the performance of fork/execve on Linux systems for