-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
deps: update V8 to 11.0 #46125
deps: update V8 to 11.0 #46125
Conversation
Review requested:
|
Build error on Windows (debug):
|
@nodejs/platform-windows @nodejs/platform-windows-arm ^ |
We also still have nodejs/node-v8#246, that I don't know how to fix. |
@targos After investigation, I could reproduce this issue on my side, during an native compilation on an arm64 machine. This issue is not reproducible when building directly v8 (either in release, or debug). For now, I would recommend to remove those static asserts on node.js side:
For the root cause, it seems that some expected structure are not standard layout type, which I don't have clue why it's the case only when compiling for arm64. A comment says breaking this property could bring trouble when using v8 snapshots, which I'm not sure if Node.js is using this now. Whatever, we can always do something if a regression appear with unit tests later. This |
It's not specific to arm64. The Windows debug build is done on x64 in our CI. |
Sorry, I thought it was an arm64 specific issue. I think you can safely delete or comment those static assert, and run (x64) CI to check everything is fine. |
We are. Fwiw, the comments read as saying that this would be an issue for cross-compilation specifically, not snapshot usage in general, so I’m not sure to what degree this applies to Node.js.
It shouldn’t be too hard to figure out why exactly this assertion is failing, and I’d probably do that before just skipping the assertions. |
I'm currently doing a bisect using V8 canary branches to narrow down the list of commits. |
I didn't see anything obvious either... |
Unfortunately, I couldn’t reproduce this by compiling natively on Ubuntu 20.04 arm64. I think one way to go about this would be to:
And that should give you the member that’s making |
The error appears somewhere between 11.0.193 and 11.0.194: v8/v8@11.0.193...11.0.194 |
@targos That’s fairly certainly v8/v8@d9aa68e then, with its addition of |
If I’m right, something like this might be a workaround? It’s a bit hacky and probably can’t be upstreamed as-is, but it should definitely not break anything. diff in the folddiff --git a/deps/v8/src/heap/base/stack.cc b/deps/v8/src/heap/base/stack.cc
index d8e618d0c964..d3ea7885ca7c 100644
--- a/deps/v8/src/heap/base/stack.cc
+++ b/deps/v8/src/heap/base/stack.cc
@@ -172,8 +172,10 @@ void Stack::IteratePointers(StackVisitor* visitor) const {
visitor, reinterpret_cast<const void* const*>(context_->stack_marker),
stack_start_, asan_fake_stack);
- for (const auto& stack : inactive_stacks_) {
- IteratePointersInStack(visitor, stack.top, stack.start, asan_fake_stack);
+ if (inactive_stacks_) {
+ for (const auto& stack : *inactive_stacks_) {
+ IteratePointersInStack(visitor, stack.top, stack.start, asan_fake_stack);
+ }
}
IterateUnsafeStackIfNecessary(visitor);
@@ -234,9 +236,12 @@ void Stack::ClearContext(bool check_invariant) {
void Stack::AddStackSegment(const void* start, const void* top) {
DCHECK_LE(top, start);
- inactive_stacks_.push_back({start, top});
+ if (!inactive_stacks_) {
+ inactive_stacks_ = std::make_unique<std::remove_reference_t<decltype(*inactive_stacks_)>>();
+ }
+ inactive_stacks_->push_back({start, top});
}
-void Stack::ClearStackSegments() { inactive_stacks_.clear(); }
+void Stack::ClearStackSegments() { if (inactive_stacks_) inactive_stacks_->clear(); }
} // namespace heap::base
diff --git a/deps/v8/src/heap/base/stack.h b/deps/v8/src/heap/base/stack.h
index 06edf4cc41b3..cda759de51da 100644
--- a/deps/v8/src/heap/base/stack.h
+++ b/deps/v8/src/heap/base/stack.h
@@ -124,7 +124,7 @@ class V8_EXPORT_PRIVATE Stack final {
const void* start;
const void* top;
};
- std::vector<StackSegments> inactive_stacks_;
+ std::unique_ptr<std::vector<StackSegments>> inactive_stacks_;
};
} // namespace heap::base |
@targos Actually, I forgot to include it you’ll probably want to adjust https://github.com/v8/v8/blob/d9aa68e85079eeaf8d50442f3bb5b22af01a0500/src/execution/thread-local-top.h#L33 to be the right number as well, but that can happen once we know that this workaround actually works |
It looks like ee3b0e5 fixed 2/4 errors. Is that expected? |
I guess the other asserts fail because I haven't updated |
Looks good now! How do we handle this? |
@targos Idk … how do we usually handle this type of issue? My patch isn’t one that is particularly risky or that I’d be scared to float on top of this V8 version indefinitely, but it would be nice if upstream V8 did something here so we could eventually get rid of it. Does opening an upstream ticket make sense? (also cc @thibaudmichaud as the original author of that change) |
For the first conflict, definitely the bottom. |
The bottom change was enough for both conflicts but there was one more change that was not merged well automatically in I have everything here: crrev.com/c/4200636. I checked the tests locally and on our bots, plus our four "node_ci" bots. Three of them seem to fail for a long time, so I assume they have nothing to do with this change. It seems that this works OK, but please try your tests before merging it. |
Major V8 updates are usually API/ABI incompatible with previous versions. This commit adapts NODE_MODULE_VERSION for V8 11.0. Refs: https://github.com/nodejs/CTC/blob/master/meetings/2016-09-28.md
dllexport introduces issues when compiling with MSVC.
PR-URL: nodejs#45579 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
Original commit message: [cppgc]: Fix build on msvc Fixes compilation with msvc 2019 toolchain. See: nodejs#37330 (comment) Bug: v8:12661 Change-Id: I7cfd87a3dd531a2e4913d82b743fb8ecdfdb5ed8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3533019 Reviewed-by: Michael Lippautz <[email protected]> Commit-Queue: Michael Lippautz <[email protected]> Cr-Commit-Position: refs/heads/main@{#85087} Refs: v8/v8@166fd2f
Original commit message: [heap] Move the Stack object from ThreadLocalTop to Isolate Stack information is thread-specific and, until now, it was stored in a field in ThreadLocalTop. This CL moves stack information to the isolate and makes sure to update the stack start whenever a main thread enters the isolate. At the same time, the Stack object is refactored and simplified. As a side effect, after removing the Stack object, ThreadLocalTop satisfies the std::standard_layout trait; this fixes some issues observed with different C++ compilers. Bug: v8:13630 Bug: v8:13257 Change-Id: I026a35af3bc6999a09b21f277756d4454c086343 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4152476 Reviewed-by: Michael Lippautz <[email protected]> Reviewed-by: Omer Katz <[email protected]> Commit-Queue: Nikolaos Papaspyrou <[email protected]> Cr-Commit-Position: refs/heads/main@{#85445} Refs: v8/v8@1e4b71d Refs: https://chromium-review.googlesource.com/c/v8/v8/+/4200636 Co-Authored-By: Nikolaos Papaspyrou <[email protected]>
Thanks a lot @nickie, I backported your changes! |
We still have the problem with test-worker-init-failure nodejs/node-v8#246 |
Is the related test case marked as flaky? I don't see failure on CI. |
I don't think it's flaky. It failed in all CI runs (e.g. node-test-commit-arm-debug) |
It seems that this crash doesn't happen with canary anymore (since last week, two runs didn't fail). Since there's no rush to land a V8 update at the moment, I'll try to open another PR for V8 11.1. |
No description provided.