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

[help wanted] deps: update V8 to 13.6 #57753

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from
Draft

[help wanted] deps: update V8 to 13.6 #57753

wants to merge 35 commits into from

Conversation

targos
Copy link
Member

@targos targos commented Apr 5, 2025

I hope it can replace #57114

Notable changes:

@nodejs/v8-update @nodejs/tsc

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/security-wg
  • @nodejs/tsc
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. dependencies Pull requests that update a dependency file. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. labels Apr 5, 2025
@targos
Copy link
Member Author

targos commented Apr 5, 2025

@joyeecheung (or maybe someone else from @nodejs/cpp-reviewers) Can you help finalizing 05eab64 ?
I ported all the referenced PRs from #52718 but there is an issue with node_mksnapshot:

[1903/1919] ACTION node: node_mksnapshot_9b7a2d2290b02e76d66661df74749f56
FAILED: gen/node_snapshot.cc
cd ../../; export BUILT_FRAMEWORKS_DIR=/Users/mzasso/git/nodejs/v8-next-update/out/Debug; export BUILT_PRODUCTS_DIR=/Users/mzasso/git/nodejs/v8-next-update/out/Debug; export CONFIGURATION=Debug; export EXECUTABLE_NAME=node; export EXECUTABLE_PATH=node; export FULL_PRODUCT_NAME=node; export PRODUCT_NAME=node; export PRODUCT_TYPE=com.apple.product-type.tool; export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk; export SRCROOT=/Users/mzasso/git/nodejs/v8-next-update/out/Debug/../../; export SOURCE_ROOT="${SRCROOT}"; export TARGET_BUILD_DIR=/Users/mzasso/git/nodejs/v8-next-update/out/Debug; export TEMP_DIR="${TMPDIR}"; export XCODE_VERSION_ACTUAL=1630;/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot /Users/mzasso/git/nodejs/v8-next-update/out/Debug/gen/node_snapshot.cc

  #  /Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot[39108]: IsolatePlatformDelegate *node::NodePlatform::ForIsolate(Isolate *) at ../../src/node_platform.cc:530
  #  Assertion failed: (data.first) != nullptr

----- Native stack trace -----

 1: 0x104f36d9c node::DumpNativeBacktrace(__sFILE*) [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
 2: 0x1050a0e5c node::Assert(node::AssertionInfo const&) [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
 3: 0x10519b9a4 node::NodePlatform::ForIsolate(v8::Isolate*) [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
 4: 0x10519bcec node::NodePlatform::GetForegroundTaskRunner(v8::Isolate*, v8::TaskPriority) [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
 5: 0x106ffd978 cppgc::internal::Sweeper::SweeperImpl::Start(cppgc::internal::SweepingConfig) [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
 6: 0x106feda98 cppgc::internal::HeapBase::Terminate() [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
 7: 0x1060c52d0 v8::internal::CppHeap::~CppHeap() [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
 8: 0x1060c5368 non-virtual thunk to v8::internal::CppHeap::~CppHeap() [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
 9: 0x10613ba18 v8::internal::Heap::TearDown() [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
10: 0x1060382d8 v8::internal::Isolate::Deinit() [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
11: 0x106037dbc v8::internal::Isolate::Delete(v8::internal::Isolate*) [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
12: 0x105325a74 node::RAIIIsolateWithoutEntering::~RAIIIsolateWithoutEntering() [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
13: 0x105325aa8 node::RAIIIsolateWithoutEntering::~RAIIIsolateWithoutEntering() [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
14: 0x105325b60 node::RAIIIsolate::~RAIIIsolate() [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
15: 0x105325b8c node::RAIIIsolate::~RAIIIsolate() [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
16: 0x1051fdf20 node::BuildCodeCacheFromSnapshot(node::SnapshotData*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
17: 0x1051fe2c4 node::SnapshotBuilder::Generate(node::SnapshotData*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::optional<std::__1::basic_string_view<char, std::__1::char_traits<char>>>, node::SnapshotConfig const&) [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
18: 0x1051fedac node::SnapshotBuilder::GenerateAsSource(char const*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, node::SnapshotConfig const&, bool) [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
19: 0x104e2c4bc BuildSnapshot(int, char**) [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
20: 0x104e2c220 main [/Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot]
21: 0x1943c6b4c start [/usr/lib/dyld]
/bin/sh: line 1: 39108 Abort trap: 6           /Users/mzasso/git/nodejs/v8-next-update/out/Debug/node_mksnapshot /Users/mzasso/git/nodejs/v8-next-update/out/Debug/gen/node_snapshot.cc

@targos targos marked this pull request as draft April 5, 2025 09:11
@targos targos added the semver-major PRs that contain breaking changes and should be released in the next major version. label Apr 5, 2025
targos and others added 20 commits April 6, 2025 13:13
Major V8 updates are usually API/ABI incompatible with previous
versions. This commit adapts NODE_MODULE_VERSION for V8 13.6.

Refs: https://github.com/nodejs/CTC/blob/master/meetings/2016-09-28.md
dllexport introduces issues when compiling with MSVC.

PR-URL: nodejs#47251
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
It introduces process hangs on some platforms because Node.js doesn't
tear down V8 correctly.
Disable it while we work on a solution.

Refs: nodejs#47297
Refs: https://bugs.chromium.org/p/v8/issues/detail?id=13902
PR-URL: nodejs#47450
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
PR-URL: nodejs#54077
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
PR-URL: nodejs#53134
Refs: nodejs#52809
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#55014
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
It's causing compiler errors with some classes on Xcode 11
and the attribute should have no runtime effect.

PR-URL: nodejs#54077
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
PR-URL: nodejs#55014
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
It's causing linker errors with node.lib in node-gyp and potentially
breaks other 3rd party tools

PR-URL: nodejs#56238
Refs: nodejs#55784
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: nodejs#55014
Reviewed-By: Matteo Collina <[email protected]>
GCC emits warnings because of the trailing backslashes.
Build Node.js with simdutf version from V8.

Refs: v8/v8@d629051
Refs: v8/v8@616c875
Refs: v8/v8@e3204d5
Refs: v8/v8@e8293d2
Refs: v8/v8@aeb2220
Refs: v8/v8@5621164
Co-authored-by: Abdirahim Musse <[email protected]>
@targos targos changed the title deps: update V8 to 13.6 [help wanted] deps: update V8 to 13.6 Apr 6, 2025
@targos targos added the help wanted Issues that need assistance from volunteers or PRs that need help to proceed. label Apr 6, 2025
@danmcd
Copy link

danmcd commented Apr 6, 2025

I will run a build on illumos/SmartOS. If you fixed the JSDispatchEntry assumptions about high-16-bits in kFreeEntryTag that'll help out a lot.

@danmcd
Copy link

danmcd commented Apr 7, 2025

I will run a build on illumos/SmartOS. If you fixed the JSDispatchEntry assumptions about high-16-bits in kFreeEntryTag that'll help out a lot.

I used some brute-force to clear the high-16-bits in the userland address space so v8 can do its thing. It stopped failing where it used to and started failing somewhere else, but still in node_mksnapshot.

In non-debug/stock:

  LD_LIBRARY_PATH=/home/danmcd/targos-v8-136/out/Release/lib.host:/home/danmcd/targos-v8-136/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; mkdir -p /home/danmcd/targos-v8-136/out/Release/obj/gen; "/home/danmcd/targos-v8-136/out/Release/node_mksnapshot" "/home/danmcd/targos-v8-136/out/Release/obj/gen/node_snapshot.cc"

  #  [20437]: node::IsolatePlatformDelegate* node::NodePlatform::ForIsolate(v8::Isolate*) at ../src/node_platform.cc:530
  #  Assertion failed: (data.first) != nullptr

In debug (using --v8-non-optimized-debug --v8-with-dchecks --v8-enable-object-print) I get the same error.

I noticed on #57114 that @bnoordhuis had a suggestion too that might ease the requirement for me to do something drastic (at least in the short term?).

If v8 documents "pointer requirements" somewhere, that'd help me a lot. I'm visiting the v8-dev google group now, so they may give me the clues I need.

EDIT/UPDATE ==> I didn't look carefully before at @targos 's update ==> I'm encountering the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. dependencies Pull requests that update a dependency file. help wanted Issues that need assistance from volunteers or PRs that need help to proceed. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants