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

test/js-native-api/test_object/test.js fails with debug build #273

Closed
targos opened this issue Dec 7, 2023 · 1 comment · Fixed by nodejs/node#51149
Closed

test/js-native-api/test_object/test.js fails with debug build #273

targos opened this issue Dec 7, 2023 · 1 comment · Fixed by nodejs/node#51149

Comments

@targos
Copy link
Member

targos commented Dec 7, 2023

@nodejs/node-api

$ out/Debug/node test/js-native-api/test_object/test.js


#
# Fatal error in ../../deps/v8/src/objects/map-inl.h, line 821
# Debug check failed: IsNativeContext(meta_map->native_context_or_null()).
#
#
#
#FailureMessage Object: 0x16dbfd1e8
----- Native stack trace -----

 1: 0x10232a26c node::DumpNativeBacktrace(__sFILE*) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
 2: 0x10256ee6c node::NodePlatform::GetStackTracePrinter()::$_3::operator()() const [/Users/mzasso/git/nodejs/canary/out/Debug/node]
 3: 0x10256ee28 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/Users/mzasso/git/nodejs/canary/out/Debug/node]
 4: 0x10465dc80 V8_Fatal(char const*, int, char const*, ...) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
 5: 0x10465d81c std::__1::enable_if<!std::is_function<std::__1::remove_pointer<char>::type>::value && !std::is_enum<char>::value && has_output_operator<char, v8::base::CheckMessageStream>::value, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>::type v8::base::PrintCheckOperand<char>(char) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
 6: 0x102b28d64 v8::internal::Map::TryGetBackPointer(v8::internal::PtrComprCageBase, v8::internal::Tagged<v8::internal::Map>*) const [/Users/mzasso/git/nodejs/canary/out/Debug/node]
 7: 0x1031bfb34 v8::internal::LookupIterator::ApplyTransitionToDataProperty(v8::internal::Handle<v8::internal::JSReceiver>) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
 8: 0x10324d83c v8::internal::Object::TransitionAndWriteDataProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::Maybe<v8::internal::ShouldThrow>, v8::internal::StoreOrigin) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
 9: 0x10324d03c v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::Maybe<v8::internal::ShouldThrow>, v8::internal::StoreOrigin, v8::internal::EnforceDefineSemantics) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
10: 0x1030f7abc v8::internal::JSObject::DefineOwnPropertyIgnoreAttributes(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::Maybe<v8::internal::ShouldThrow>, v8::internal::JSObject::AccessorInfoHandling, v8::internal::EnforceDefineSemantics, v8::internal::StoreOrigin) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
11: 0x1030f6fd8 v8::internal::JSObject::DefineOwnPropertyIgnoreAttributes(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::JSObject::AccessorInfoHandling, v8::internal::EnforceDefineSemantics) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
12: 0x1028351d8 v8::Object::SetPrivate(v8::Local<v8::Context>, v8::Local<v8::Private>, v8::Local<v8::Value>) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
13: 0x1023c02a8 napi_type_tag_object [/Users/mzasso/git/nodejs/canary/out/Debug/node]
14: 0x10a8a1fe0 TypeTaggedExternal [/Users/mzasso/git/nodejs/canary/test/js-native-api/test_object/build/Debug/test_object.node]
15: 0x1023c6720 v8impl::(anonymous namespace)::CallbackWrapperBase::InvokeCallback()::'lambda'(napi_env__*)::operator()(napi_env__*) const [/Users/mzasso/git/nodejs/canary/out/Debug/node]
16: 0x1023c661c void napi_env__::CallIntoModule<v8impl::(anonymous namespace)::CallbackWrapperBase::InvokeCallback()::'lambda'(napi_env__*), v8impl::(anonymous namespace)::CallbackWrapperBase::InvokeCallback()::'lambda'(napi_env__*, v8::Local<v8::Value>)>(v8impl::(anonymous namespace)::CallbackWrapperBase::InvokeCallback()::'lambda'(napi_env__*)&&, v8impl::(anonymous namespace)::CallbackWrapperBase::InvokeCallback()::'lambda'(napi_env__*, v8::Local<v8::Value>)&&) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
17: 0x1023c6204 v8impl::(anonymous namespace)::CallbackWrapperBase::InvokeCallback() [/Users/mzasso/git/nodejs/canary/out/Debug/node]
18: 0x1023c6104 v8impl::(anonymous namespace)::FunctionCallbackWrapper::Invoke(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
19: 0x103aee3f8 Builtins_CallApiCallbackGeneric [/Users/mzasso/git/nodejs/canary/out/Debug/node]
20: 0x103aec370 Builtins_InterpreterEntryTrampoline [/Users/mzasso/git/nodejs/canary/out/Debug/node]
21: 0x103aec370 Builtins_InterpreterEntryTrampoline [/Users/mzasso/git/nodejs/canary/out/Debug/node]
22: 0x103aec370 Builtins_InterpreterEntryTrampoline [/Users/mzasso/git/nodejs/canary/out/Debug/node]
23: 0x103aec370 Builtins_InterpreterEntryTrampoline [/Users/mzasso/git/nodejs/canary/out/Debug/node]
24: 0x103aec370 Builtins_InterpreterEntryTrampoline [/Users/mzasso/git/nodejs/canary/out/Debug/node]
25: 0x103aec370 Builtins_InterpreterEntryTrampoline [/Users/mzasso/git/nodejs/canary/out/Debug/node]
26: 0x103aec370 Builtins_InterpreterEntryTrampoline [/Users/mzasso/git/nodejs/canary/out/Debug/node]
27: 0x103ae980c Builtins_JSEntryTrampoline [/Users/mzasso/git/nodejs/canary/out/Debug/node]
28: 0x103ae94f4 Builtins_JSEntry [/Users/mzasso/git/nodejs/canary/out/Debug/node]
29: 0x102b6062c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
30: 0x102b5fad4 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
31: 0x10283df24 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
32: 0x10242308c node::builtins::BuiltinLoader::CompileAndCall(v8::Local<v8::Context>, char const*, int, v8::Local<v8::Value>*, node::Realm*) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
33: 0x102422f10 node::builtins::BuiltinLoader::CompileAndCall(v8::Local<v8::Context>, char const*, node::Realm*) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
34: 0x102592450 node::Realm::ExecuteBootstrapper(char const*) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
35: 0x1023dd22c node::StartExecution(node::Environment*, char const*) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
36: 0x1023dd028 node::StartExecution(node::Environment*, std::__1::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
37: 0x10227d730 node::LoadEnvironment(node::Environment*, std::__1::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
38: 0x1024ed9f4 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
39: 0x1024ed62c node::NodeMainInstance::Run() [/Users/mzasso/git/nodejs/canary/out/Debug/node]
40: 0x1023dfa80 node::StartInternal(int, char**) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
41: 0x1023df6c0 node::Start(int, char**) [/Users/mzasso/git/nodejs/canary/out/Debug/node]
42: 0x1040cf018 main [/Users/mzasso/git/nodejs/canary/out/Debug/node]
43: 0x1844d10e0 start [/usr/lib/dyld]
[1]    82285 trace trap  out/Debug/node test/js-native-api/test_object/test.js
@legendecas
Copy link
Member

I can reproduce the problem and confirm that napi_type_tag_object was based on an assumption that v8::External can have private properties. This assumption is broken with the latest V8.

nodejs-github-bot pushed a commit to nodejs/node that referenced this issue Dec 22, 2023
v8::External can not have any properties and private properties. Type
tag v8::External with a wrapper struct without setting a private
property on the v8::External.

PR-URL: #51149
Fixes: nodejs/node-v8#273
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
RafaelGSS pushed a commit to nodejs/node that referenced this issue Jan 2, 2024
v8::External can not have any properties and private properties. Type
tag v8::External with a wrapper struct without setting a private
property on the v8::External.

PR-URL: #51149
Fixes: nodejs/node-v8#273
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
richardlau pushed a commit to nodejs/node that referenced this issue Mar 25, 2024
v8::External can not have any properties and private properties. Type
tag v8::External with a wrapper struct without setting a private
property on the v8::External.

PR-URL: #51149
Fixes: nodejs/node-v8#273
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants