Uh oh!
There was an error while loading. Please reload this page.
deps: update V8 to 11.0 - #46125
Conversation
nodejs-github-bot
commented
Jan 7, 2023
Review requested:
|
nodejs-github-bot
commented
Jan 7, 2023
nodejs-github-bot
commented
Jan 7, 2023
nodejs-github-bot
commented
Jan 7, 2023
targos
commented
Jan 7, 2023
Build error on Windows (debug): |
targos
commented
Jan 7, 2023
@nodejs/platform-windows @nodejs/platform-windows-arm ^ |
targos
commented
Jan 7, 2023
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 |
targos
commented
Jan 9, 2023
It's not specific to arm64. The Windows debug build is done on x64 in our CI. |
p-b-o
commented
Jan 9, 2023
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. |
addaleax
commented
Jan 9, 2023
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. |
targos
commented
Jan 9, 2023
I'm currently doing a bisect using V8 canary branches to narrow down the list of commits. |
p-b-o
commented
Jan 9, 2023
I didn't see anything obvious either... |
addaleax
commented
Jan 9, 2023
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 |
targos
commented
Jan 9, 2023
The error appears somewhere between 11.0.193 and 11.0.194: v8/v8@11.0.193...11.0.194 |
addaleax
commented
Jan 9, 2023
@targos That’s fairly certainly v8/v8@d9aa68e then, with its addition of |
addaleax
commented
Jan 9, 2023
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 |
addaleax
commented
Jan 9, 2023
@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 |
targos
commented
Jan 9, 2023
It looks like ee3b0e5 fixed 2/4 errors. Is that expected? |
targos
commented
Jan 9, 2023
I guess the other asserts fail because I haven't updated |
targos
commented
Jan 9, 2023
Looks good now! How do we handle this? |
addaleax
commented
Jan 10, 2023
@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) |
nickie
commented
Jan 29, 2023
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 <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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 <mlippautz@chromium.org> Commit-Queue: Michael Lippautz <mlippautz@chromium.org> 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 <mlippautz@chromium.org> Reviewed-by: Omer Katz <omerkatz@chromium.org> Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org> 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 <nikolaos@chromium.org>
targos
commented
Jan 30, 2023
Thanks a lot @nickie, I backported your changes! |
nodejs-github-bot
commented
Jan 30, 2023
nodejs-github-bot
commented
Jan 30, 2023
nodejs-github-bot
commented
Jan 30, 2023
nodejs-github-bot
commented
Jan 31, 2023
nodejs-github-bot
commented
Jan 31, 2023
targos
commented
Jan 31, 2023
We still have the problem with test-worker-init-failure nodejs/node-v8#246 |
gengjiawen
commented
Jan 31, 2023
Is the related test case marked as flaky? I don't see failure on CI. |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
targos
commented
Jan 31, 2023
I don't think it's flaky. It failed in all CI runs (e.g. node-test-commit-arm-debug) |
targos
commented
Jan 31, 2023
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.