Open minggangw opened 3 years ago
I found a similar issue from nodejs, please see https://github.com/nodejs/node/issues/32463 @addaleax would you please help to have a look? Thanks!
@minggangw Without a smaller reproduction, I don’t think it’s going to be feasible for me to look into this in much detail
Thanks for your reply and I will try to narrow it down to find any useful clue.
@addalex Here's a script that breaks on macOS 11.0.1, using node 14.15.1 or 15.3.0. Works fine on node 12.
#!/usr/bin/env node
const ffi = require('ffi-napi');
const ref = require('ref-napi');
const ArrayType = require('ref-array-napi');
const lib = ffi.Library(null, {
execvp: ['int', ['string', ArrayType('string')]],
dup2: ['int', ['int', 'int']],
});
[process.stdin, process.stdout, process.stderr].forEach((x, i) => {
lib.dup2(x._handle.fd, i);
});
lib.execvp('echo', ['', 'foo', ref.NULL]);
Trace:
#
# Fatal error in , line 0
# Check failed: result.second.
#
#
#
#FailureMessage Object: 0x7ffeefbfcd40
1: 0x1001137c2 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/Users/foo/.nvm/versions/node/v14.15.1/bin/node]
2: 0x10100e4f2 V8_Fatal(char const*, ...) [/Users/foo/.nvm/versions/node/v14.15.1/bin/node]
3: 0x1004d4d44 v8::internal::GlobalBackingStoreRegistry::Register(std::__1::shared_ptr<v8::internal::BackingStore>) [/Users/foo/.nvm/versions/node/v14.15.1/bin/node]
4: 0x1001fa9b6 v8::ArrayBuffer::GetBackingStore() [/Users/foo/.nvm/versions/node/v14.15.1/bin/node]
5: 0x100069fce napi_get_typedarray_info [/Users/foo/.nvm/versions/node/v14.15.1/bin/node]
6: 0x11112e6f8 (anonymous namespace)::WrapPointer(Napi::Env, char*, unsigned long) [/Users/foo/dev/...snip.../node_modules/ref-napi/prebuilds/darwin-x64/node.napi.node]
7: 0x11112f2a9 (anonymous namespace)::ReadPointer(Napi::CallbackInfo const&) [/Users/foo/dev/...snip.../node_modules/ref-napi/prebuilds/darwin-x64/node.napi.node]
8: 0x1046eb53f napi_value__* Napi::details::WrapCallback<Napi::details::CallbackData<Napi::Value (*)(Napi::CallbackInfo const&), Napi::Value>::Wrapper(napi_env__*, napi_callback_info__*)::'lambda'()>(Napi::Value (*)(Napi::CallbackInfo const&)) [/Users/foo/dev/...snip.../node_modules/ffi-napi/node_modules/ref-napi/prebuilds/darwin-x64/node.napi.node]
9: 0x1046eb4dd Napi::details::CallbackData<Napi::Value (*)(Napi::CallbackInfo const&), Napi::Value>::Wrapper(napi_env__*, napi_callback_info__*) [/Users/foo/dev/...snip.../node_modules/ffi-napi/node_modules/ref-napi/prebuilds/darwin-x64/node.napi.node]
10: 0x10006360a v8impl::(anonymous namespace)::FunctionCallbackWrapper::Invoke(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/foo/.nvm/versions/node/v14.15.1/bin/node]
11: 0x100259878 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/foo/.nvm/versions/node/v14.15.1/bin/node]
12: 0x100258e0c v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/foo/.nvm/versions/node/v14.15.1/bin/node]
13: 0x100258532 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/foo/.nvm/versions/node/v14.15.1/bin/node]
14: 0x100a796d9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/foo/.nvm/versions/node/v14.15.1/bin/node]
15: 0x100a129a2 Builtins_InterpreterEntryTrampoline [/Users/foo/.nvm/versions/node/v14.15.1/bin/node]
[1] 50613 illegal hardware instruction ./index.js
Folks, we too have run into this issue, any update on when this will be fixed pls?
Same here. Works in 12, but fails in 14 and 15.
Any update after more than a whole year?
When I upgrade Node.js to the latest LTS v14.15.0, a fatal error happens when running the unit test, but it's ok with Node.js v12, please check out the error log below:
For the detailed log, please see https://travis-ci.org/github/RobotWebTools/rclnodejs/builds/739832615
Thanks!