| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Review requested:
|
Sorry, something went wrong.
Sorry, something went wrong.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/48888/ |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
Build error on Windows (debug): 10:45:39 C:\workspace\node-compile-windows-debug\node\deps\v8\src\execution\isolate-data.h(279,58): error C2607: static assertion failed [C:\workspace\node-compile-windows-debug\node\tools\v8_gypfiles\v8_init.vcxproj] 10:45:39 C:\workspace\node-compile-windows-debug\node\deps\v8\src\execution\isolate-data.h(281,55): error C2607: static assertion failed [C:\workspace\node-compile-windows-debug\node\tools\v8_gypfiles\v8_init.vcxproj] 10:45:39 C:\workspace\node-compile-windows-debug\node\deps\v8\src\execution\isolate-data.h(284,3): error C2607: static assertion failed [C:\workspace\node-compile-windows-debug\node\tools\v8_gypfiles\v8_init.vcxproj] 10:45:39 C:\workspace\node-compile-windows-debug\node\deps\v8\src\execution\isolate-data.h(286,37): error C2607: static assertion failed [C:\workspace\node-compile-windows-debug\node\tools\v8_gypfiles\v8_init.vcxproj] |
Sorry, something went wrong.
|
@nodejs/platform-windows @nodejs/platform-windows-arm ^ |
Sorry, something went wrong.
|
We also still have nodejs/node-v8#246, that I don't know how to fix. |
Sorry, something went wrong.
|
@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: diff --git a/deps/v8/src/execution/isolate-data.h b/deps/v8/src/execution/isolate-data.h
index 9886287fe0..0a2ca12f58 100644
--- a/deps/v8/src/execution/isolate-data.h
+++ b/deps/v8/src/execution/isolate-data.h
@@ -275,15 +275,6 @@ class IsolateData final {
// issues because of different compilers used for snapshot generator and
// actual V8 code.
void IsolateData::AssertPredictableLayout() {
- static_assert(std::is_standard_layout<RootsTable>::value);
- static_assert(std::is_standard_layout<ThreadLocalTop>::value);
- static_assert(std::is_standard_layout<ExternalReferenceTable>::value);
- static_assert(std::is_standard_layout<IsolateData>::value);
-#define V(Offset, Size, Name) \
- static_assert(offsetof(IsolateData, Name##_) == Offset);
- ISOLATE_DATA_FIELDS(V)
-#undef V
- static_assert(sizeof(IsolateData) == IsolateData::kSize);
}
#undef ISOLATE_DATA_FIELDS_POINTER_COMPRESSION
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 static_assert stuff has been around for quite some time in v8 code, so it's not new. If you want to nail down the exact root cause, you'll need to bisect which commit exactly introduced this regression in one of those structures, something I alas don't have the time to do for now. |
Sorry, something went wrong.
|
It's not specific to arm64. The Windows debug build is done on x64 in our CI. |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
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. |
Sorry, something went wrong.
|
I'm currently doing a bisect using V8 canary branches to narrow down the list of commits. |
Sorry, something went wrong.
|
I didn't see anything obvious either... |
Sorry, something went wrong.
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 ThreadLocalTop have a non-standard layout. This might sound tricky, but it shouldn’t be too complex, as long as you locally have a reproduction of the issue. |
Sorry, something went wrong.
|
The error appears somewhere between 11.0.193 and 11.0.194: v8/v8@11.0.193...11.0.194 |
Sorry, something went wrong.
|
@targos That’s fairly certainly v8/v8@d9aa68e then, with its addition of v8::heap::base::Stack::inactive_stacks_. I’m guessing std::vector<> doesn’t necessarily have standard layout (and/or not consist of exactly three pointer-sized members) here. |
Sorry, something went wrong.
|
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 |
Sorry, something went wrong.
|
@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 |
Sorry, something went wrong.
Sorry, something went wrong.
|
It looks like ee3b0e5 fixed 2/4 errors. Is that expected? |
Sorry, something went wrong.
|
I guess the other asserts fail because I haven't updated kSizeInBytes... |
Sorry, something went wrong.
Sorry, something went wrong.
|
Looks good now! How do we handle this? |
Sorry, something went wrong.
|
@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) |
Sorry, something went wrong.
|
For the first conflict, definitely the bottom. |
Sorry, something went wrong.
|
The bottom change was enough for both conflicts but there was one more change that was not merged well automatically in thread-local-top.cc (one line with stack_ needed to be removed). 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. |
Sorry, something went wrong.
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>
|
Thanks a lot @nickie, I backported your changes! |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
We still have the problem with test-worker-init-failure nodejs/node-v8#246 |
Sorry, something went wrong.
Is the related test case marked as flaky? I don't see failure on CI. |
Sorry, something went wrong.
|
I don't think it's flaky. It failed in all CI runs (e.g. node-test-commit-arm-debug) |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
No description provided.