-
Notifications
You must be signed in to change notification settings - Fork 672
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
Error "dyld[35932]: missing symbol called" on MacOS #1146
Comments
This problem doesn't happen on version "resolutions": {
"node-ssh/ssh2": "~1.1.0"
} |
I just pushed something that may fix this. Can you check if the master branch fixes this problem for you? |
@mscdex we just did a re-clone (because I tried to pull and re-test it still can't) and repeat the previous step I explained, the problem message still appears This is the gyp info output when compiling gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info find Python using Python version 3.9.10 found at "/usr/local/opt/[email protected]/bin/python3.9"
gyp info spawn /usr/local/opt/[email protected]/bin/python3.9
gyp info spawn args [
gyp info spawn args '/usr/local/Cellar/node/17.6.0_1/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/user/ssh2/lib/protocol/crypto/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/Cellar/node/17.6.0_1/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/moer/Library/Caches/node-gyp/17.6.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/moer/Library/Caches/node-gyp/17.6.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/Cellar/node/17.6.0_1/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/moer/Library/Caches/node-gyp/17.6.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/user/ssh2/lib/protocol/crypto',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/sshcrypto/src/binding.o
SOLINK_MODULE(target) Release/sshcrypto.node
gyp info ok
Succeeded in building optional crypto binding test error output still same as before |
this errors only happened on version But, when building and rebuilding binary, I got this error when compiling version In file included from ../src/binding.cc:10:
In file included from /Users/user/Library/Caches/node-gyp/17.6.0/include/node/openssl/err.h:4:
In file included from /Users/user/Library/Caches/node-gyp/17.6.0/include/node/openssl/./err_asm.h:17:
In file included from /Users/user/Library/Caches/node-gyp/17.6.0/include/node/openssl/./archs/darwin64-x86_64-cc/asm/include/openssl/err.h:16:
/Users/user/Library/Caches/node-gyp/17.6.0/include/node/openssl/macros.h:155:4: error: "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
# error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
^
1 error generated.
make: *** [Release/obj.target/sshcrypto/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/Cellar/node/17.6.0_1/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (node:events:527:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 21.3.0
gyp ERR! command "/usr/local/Cellar/node/17.6.0_1/bin/node" "/usr/local/Cellar/node/17.6.0_1/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "--target=v17.6.0" "rebuild"
gyp ERR! cwd /Users/user/ssh2/lib/protocol/crypto
gyp ERR! node -v v17.6.0
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok
Failed to build optional crypto binding |
I'm unable to reproduce the problem in GH Actions on macOS 11.6.4 with node 17.6.0. |
It seems why I can use a version before I also realized when running testing on If you can tell me how to debug the project so that I can provide more details about this issue, I really appreciate it This is some of my node processes info: {
node: '17.6.0',
v8: '9.6.180.15-node.13',
openssl: '1.1.1m',
} |
This is Process 68788 launched: '/usr/local/bin/node' (x86_64)
dyld[68788]: missing symbol called
Process 68788 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00000001024ce0ce dyld`__abort_with_payload + 10
dyld`__abort_with_payload:
-> 0x1024ce0ce <+10>: jae 0x1024ce0d8 ; <+20>
0x1024ce0d0 <+12>: movq %rax, %rdi
0x1024ce0d3 <+15>: jmp 0x10248b120 ; cerror_nocancel
0x1024ce0d8 <+20>: retq
Target 0: (node) stopped. backtrace: (lldb) thread backtrace
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
* frame #0: 0x00000001024ce0ce dyld`__abort_with_payload + 10
frame #1: 0x00000001024e41cf dyld`abort_with_payload_wrapper_internal + 80
frame #2: 0x00000001024e4201 dyld`abort_with_payload + 9
frame #3: 0x0000000102492613 dyld`dyld4::halt(char const*) + 375
frame #4: 0x00000001024aec6e dyld`dyld4::APIs::_dyld_missing_symbol_abort() + 34
frame #5: 0x00000001036403f5 sshcrypto.node`AESGCMCipher::init(this=0x0000600000240bc0, name="aes-128-gcm", key="/~\xb8\U00000012\xf1Z\r\xdf~\xa3Ii\xe5\xb4W", key_len=16, iv="/ƽ\U00000010\xb9\U0000001cYWo\x8d#d\xbc\xf9\xe0\xc6]\U00000012T\x8f\x97_\xe5K\U0000001fAC\xf5\U0000001d\U00000018\xda\xc2 \xc3", iv_len=12) at binding.cc:398:40
frame #6: 0x000000010363fd0d sshcrypto.node`AESGCMCipher::New(info=0x00007ff7bfef5af0) at binding.cc:496:24
frame #7: 0x000000010363d8e9 sshcrypto.node`Nan::imp::FunctionCallbackWrapper(info=0x00007ff7bfef5bc0) at nan_callbacks_12_inl.h:176:3
frame #8: 0x00000001003cfba4 node`v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 584
frame #9: 0x00000001003cf4e4 node`v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(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) + 533
frame #10: 0x00000001003cf25b node`v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) + 220 |
That lldb output looks like it's for v1.7.0 and not master. Can you rerun it against the master branch? That should get rid of one deprecated symbol which might be missing in the copy of *SSL that is being used by homebrew's build of node? It's strange that's pointing to |
It's also strange that homebrew is still linking to "OpenSSL" 1.1.1m for node v17.x, which bundles OpenSSL 3.0. |
Yes. I am using homebrew's build of node. It still depends on Recloned the repo to make sure using the master branch, and rerun the testing with lldb in release binary (previous output used the debug binary, so you can find out .cc location on backtrace) ➜ ssh2 git:(master) ✗ lldb node
(lldb) target create "node"
Current executable set to 'node' (x86_64).
(lldb) run ./test/test-protocol-crypto.js
Process 81703 launched: '/usr/local/bin/node' (x86_64)
Crypto binding available
Testing cipher: null, mac: <none> (native encrypt, native decrypt) ...
Testing cipher: [email protected], mac: <implicit> (native encrypt, native decrypt) ...
Testing cipher: [email protected], mac: <implicit> (binding encrypt, native decrypt) ...
dyld[81703]: missing symbol called
Process 81703 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00000001024ce0ce dyld`__abort_with_payload + 10
dyld`__abort_with_payload:
-> 0x1024ce0ce <+10>: jae 0x1024ce0d8 ; <+20>
0x1024ce0d0 <+12>: movq %rax, %rdi
0x1024ce0d3 <+15>: jmp 0x10248b120 ; cerror_nocancel
0x1024ce0d8 <+20>: retq
Target 0: (node) stopped.
(lldb) thread backtrace
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
* frame #0: 0x00000001024ce0ce dyld`__abort_with_payload + 10
frame #1: 0x00000001024e41cf dyld`abort_with_payload_wrapper_internal + 80
frame #2: 0x00000001024e4201 dyld`abort_with_payload + 9
frame #3: 0x0000000102492613 dyld`dyld4::halt(char const*) + 375
frame #4: 0x00000001024aec6e dyld`dyld4::APIs::_dyld_missing_symbol_abort() + 34
frame #5: 0x000000010350e16a sshcrypto.node`ChaChaPolyCipher::init(unsigned char*, unsigned long) + 122
frame #6: 0x000000010350d7d0 sshcrypto.node`ChaChaPolyCipher::New(Nan::FunctionCallbackInfo<v8::Value> const&) + 288
frame #7: 0x00000001035091f7 sshcrypto.node`Nan::imp::FunctionCallbackWrapper(v8::FunctionCallbackInfo<v8::Value> const&) + 167
frame #8: 0x00000001003cfba4 node`v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 584
frame #9: 0x00000001003cf4e4 node`v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(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) + 533
frame #10: 0x00000001003cf25b node`v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) + 220
frame #11: 0x0000000100082bb9 node`Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
frame #12: 0x000000010000f1d8 node`Builtins_JSBuiltinsConstructStub + 280
frame #13: 0x0000000100118048 node`Builtins_ConstructHandler + 712
frame #14: 0x0000000100011c0e node`Builtins_InterpreterEntryTrampoline + 206
frame #15: 0x000000010000f00e node`construct_stub_create_deopt_addr + 275
frame #16: 0x0000000100118048 node`Builtins_ConstructHandler + 712
frame #17: 0x0000000100011c0e node`Builtins_InterpreterEntryTrampoline + 206
frame #18: 0x0000000100011c0e node`Builtins_InterpreterEntryTrampoline + 206
frame #19: 0x0000000100096422 node`Builtins_ArrayForEach + 930
frame #20: 0x0000000100011c0e node`Builtins_InterpreterEntryTrampoline + 206
frame #21: 0x0000000100041bbf node`Builtins_AsyncFunctionAwaitResolveClosure + 63
frame #22: 0x00000001000cd7b8 node`Builtins_PromiseFulfillReactionJob + 56
frame #23: 0x00000001000334f2 node`Builtins_RunMicrotasks + 626
frame #24: 0x000000010000fc03 node`Builtins_JSRunMicrotasksEntry + 131
frame #25: 0x0000000100462faf node`v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 2503
frame #26: 0x0000000100463351 node`v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 121
frame #27: 0x0000000100484c0f node`v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) + 461
frame #28: 0x0000000100484a09 node`v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) + 61
frame #29: 0x000000010014d6bc node`node::InternalCallbackScope::Close() + 442
frame #30: 0x0000000100284270 node`node::PerIsolatePlatformData::RunForegroundTask(std::__1::unique_ptr<v8::Task, std::__1::default_delete<v8::Task> >) + 250
frame #31: 0x0000000100283f65 node`node::PerIsolatePlatformData::FlushForegroundTasksInternal() + 621
frame #32: 0x0000000100282ec6 node`node::NodePlatform::DrainTasks(v8::Isolate*) + 60
frame #33: 0x000000010014e894 node`node::SpinEventLoop(node::Environment*) + 327
frame #34: 0x0000000100260025 node`node::NodeMainInstance::Run(int*, node::Environment*) + 97
frame #35: 0x000000010025fc50 node`node::NodeMainInstance::Run(node::EnvSerializeInfo const*) + 130
frame #36: 0x00000001001ee7d8 node`node::Start(int, char**) + 265
frame #37: 0x000000010248d4fe dyld`start + 462 |
Looks like you need to make a debug build to get the line numbers:
|
Ok, after testing the homebrew version of node on GH Actions, I'm seeing some errors only when running tests with node v17.5.0 (not sure if it's the same issue you're having or if it's a problem with GH Actions' macos environment). I'm wondering if what's happening is that the addon is being built against one version of OpenSSL but then picking up a different OpenSSL version during runtime. |
Another problem this difference in OpenSSL versions causes is that you have homebrew building against OpenSSL 1.x, but when npm goes to build addons it uses its own node-gyp which pulls in node-related headers, which includes the OpenSSL headers that version of node was bundled with (e.g. OpenSSL 3.x in the case of node v17.x). That might work ok for some addons, but the problems show up when you encounter situations where OpenSSL 3.x has moved function definitions to a #define that points to the new function name. One example of this is with OpenSSL's int EVP_CIPHER_get_key_length(const EVP_CIPHER *cipher);
# define EVP_CIPHER_key_length EVP_CIPHER_get_key_length So when the addon gets compiled, the token gets replaced and during runtime with the older OpenSSL, it can't find the symbol because Because of this situation I'm not sure that this is something that can be solved by this project. IMO because homebrew has chosen to involve a version of OpenSSL that does not match the version bundled with this particular version of node (v17.x), it is homebrew's responsibility to make sure that compatibility is preserved. Maybe that means them having to update the homebrew node formula so that it depends on Either way, I would suggest taking this problem up with the homebrew folks on their issue tracker. |
Lastly, an alternative until homebrew fixes things is to install the previous node branch (node@16) or use a different method for installing node, such as nvm or some other version manager for node. That should help ensure the correct OpenSSL version is used everywhere: from node itself to node addons. |
Yeah, it strange that they are still using version
Just installing If you find out that this issue has been resolved or not relavant, you freely can close this issue. Thanks for your time, really appreaciate that. |
I'll close it for now as there's nothing |
I take my previous statement back. As much as I don't prefer the solution I ended up with (dynamically loading problematic symbols), the solution in the master branch should work now if you want to try with your original copy of node. |
@mscdex just tested it, and I can confirm it worked like a charm on homebrew's build with |
Awesome, thanks for the update! |
I have this issue on ARM64 macbook, but only when using NPM strangely. If I install locally it doesn't error. The problem comes from mscdex/cpu-features#7 |
@alexbosworth What do you mean by "install locally" ? How did you install node? What node version are you using? |
Thanks for the response Install locally as in, if I use the dependency via a file:// link to my other library that is using this as a dependency: https://www.npmjs.com/package/ln-docker-daemons - installing the lib from npm breaks, installing the lib from file:// works. I tracked it down to breaking at cpu features I've tried different node installs like installing from https://nodejs.org/en/ via the pkg there (16.14.2) and also via homebrew, also 17.8.0, it didn't seem to make any difference One thing I haven't tried is restarting - I'm running MacOS 12.0.1 and I am up to date on XCode CLI stuff |
FWIW I've installed Those were all run on Github's infrastructure, which is currently on macOS 11.6.5. |
Do you get the symbol errors when you run the |
If I try it normally on a fresh npm install
If I try doing
|
That sounds like you're installing with a newer version of node but running the tests with an older version. Modules version 102 corresponds to node v17.x and modules version 93 corresponds with node v16.x. |
With node v12-v17 from either homebrew or binaries from nodejs.org, I do not get any symbol errors when running the |
I also get the same error
node -v reports |
The last working commit for me is |
Since we've identified it's definitely coming from |
I am using
node-ssh
to connect and upload files to our ssh server, previously used version^12.0.1
but today decided to update to version^12.0.3
, suddenly gotdyld[35932]: missing symbol called
error when running script. It seems the owner ofnode-ssh
recently update to newer version ofssh2
.Error
Where
35932
is just process id.I also try to clone this repository and running:
yarn install yarn test
The install prosess is succeed. But the testing return this error:
Machine:
v17.6.0
OpenSSH_8.6p1, LibreSSL 2.8.3
The text was updated successfully, but these errors were encountered: