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

Error "dyld[35932]: missing symbol called" on MacOS #1146

Closed
qoqn opened this issue Mar 7, 2022 · 30 comments
Closed

Error "dyld[35932]: missing symbol called" on MacOS #1146

qoqn opened this issue Mar 7, 2022 · 30 comments

Comments

@qoqn
Copy link

qoqn commented Mar 7, 2022

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 got dyld[35932]: missing symbol called error when running script. It seems the owner of node-ssh recently update to newer version of ssh2.

Error

dyld[35932]: missing symbol called

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:

$ node test/test.js
> Running test-exec.js ...
dyld[35932]: missing symbol called
> Running test-integration-openssh.js ...
Testing with OpenSSH version: 8.6
dyld[35935]: missing symbol called
> Running test-misc-client-server.js ...
dyld[35949]: missing symbol called
> Running test-openssh.js ...
dyld[35951]: missing symbol called
> Running test-protocol-crypto.js ...
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[35952]: missing symbol called
> Running test-protocol-keyparser.js ...
> Running test-server-hostkeys.js ...
dyld[35959]: missing symbol called
> Running test-sftp.js ...
dyld[35960]: missing symbol called
> Running test-shell.js ...
dyld[35961]: missing symbol called
> Running test-userauth-agent-openssh.js ...
dyld[35966]: missing symbol called
/Users/user/ssh2/test/test-userauth-agent-openssh.js:108
    throw new Error('Agent test failed');
    ^

Error: Agent test failed
    at Object.<anonymous> (/Users/user/ssh2/test/test-userauth-agent-openssh.js:108:11)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

Node.js v17.6.0
> Running test-userauth-agent.js ...
dyld[35969]: missing symbol called
> Running test-userauth.js ...
dyld[35971]: missing symbol called
error Command failed with exit code 1.

Machine:

  • node: v17.6.0
  • ssh: OpenSSH_8.6p1, LibreSSL 2.8.3
  • OS: MacOS Monterey 12.2.1
  • CPU: Intel based
@qoqn
Copy link
Author

qoqn commented Mar 7, 2022

This problem doesn't happen on version 1.1.0. For node-ssh and yarn user can add this entries to package.json for temporary fix:

"resolutions": {
  "node-ssh/ssh2": "~1.1.0"
}

@mscdex
Copy link
Owner

mscdex commented Mar 7, 2022

I just pushed something that may fix this. Can you check if the master branch fixes this problem for you?

@qoqn
Copy link
Author

qoqn commented Mar 8, 2022

@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

@qoqn
Copy link
Author

qoqn commented Mar 8, 2022

this errors only happened on version v1.7.0, versions from v1.1.0 to v1.6.0 works just fine when testing, without missing symbol called.

But, when building and rebuilding binary, I got this error when compiling version v1.1.0-v1.6.0

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

@mscdex
Copy link
Owner

mscdex commented Mar 8, 2022

I'm unable to reproduce the problem in GH Actions on macOS 11.6.4 with node 17.6.0.

@qoqn
Copy link
Author

qoqn commented Mar 8, 2022

It seems why I can use a version before 1.7.0 because the build process of optional crypto binding failed, so it only uses native methods (sorry if I'm wrong, because I don't really understand too)

I also realized when running testing on test-protocol-crypto.js, the pairs in which one of them has a binding will be failed

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',
}

@qoqn
Copy link
Author

qoqn commented Mar 8, 2022

This is lldb output

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

@mscdex
Copy link
Owner

mscdex commented Mar 8, 2022

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 clear(). I'm not sure if that's because the missing symbol is inside clear() (like the one that was removed in master) or if it's because clear() itself is somehow missing? For the latter, maybe macos needs the definition of the clear() function hoisted above the destructor where it's used or something weird like that?

@mscdex
Copy link
Owner

mscdex commented Mar 8, 2022

It's also strange that homebrew is still linking to "OpenSSL" 1.1.1m for node v17.x, which bundles OpenSSL 3.0.

@qoqn
Copy link
Author

qoqn commented Mar 8, 2022

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?

Yes. I am using homebrew's build of node. It still depends on [email protected] packages as listed on their webpage.

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

@mscdex
Copy link
Owner

mscdex commented Mar 8, 2022

Looks like you need to make a debug build to get the line numbers:

  1. Edit lib/protocol/crypto.js and change /Release/sshcrypto.node to /Debug/sshcrypto.node
  2. Either edit install.js to add the --debug flag to the list of node-gyp command flags and then rerun the install.js script or change to lib/protocol/crypto and run node-gyp --debug rebuild (you might need to install node-gyp (globally) first if you don't already have it available)

@mscdex
Copy link
Owner

mscdex commented Mar 8, 2022

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.

@mscdex
Copy link
Owner

mscdex commented Mar 8, 2022

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 EVP_CIPHER_CTX_key_length(). In 1.1.1 it was an actual function, in 3.x it is now defined as:

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 EVP_CIPHER_get_key_length() never existed there.

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 openssl@3 instead of [email protected] or maybe it means having to maintain and apply patches to the npm/node-gyp they install so that node-gyp downloads a custom headers tarball with the correct OpenSSL headers in it or maybe some other solution.

Either way, I would suggest taking this problem up with the homebrew folks on their issue tracker.

@mscdex
Copy link
Owner

mscdex commented Mar 9, 2022

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.

@qoqn
Copy link
Author

qoqn commented Mar 9, 2022

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).

Yeah, it strange that they are still using version 1.1.1m for because it still works or anything, I've seen one PR that try to changed it, but in the end still not changed. I am too afraid to open issue on their tracker, i am new in contributing to this community.

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.

Just installing [email protected] using nvm as you said and it works! build and testing without any errors. And it's shipped with latest [email protected]+quic which is very impressive. I opened this issue actually if anyone has the same problem (because your's update in 1.7.0 make the build not failed with node@17) they can find out where the error is. Hopefully homebrew will upgrade their's node build soon using latest openssl@3.

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.

@mscdex
Copy link
Owner

mscdex commented Mar 9, 2022

I'll close it for now as there's nothing ssh2 can do on its own to fix these particular errors.

@mscdex mscdex closed this as completed Mar 9, 2022
@mscdex
Copy link
Owner

mscdex commented Mar 15, 2022

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.

@qoqn
Copy link
Author

qoqn commented Mar 16, 2022

@mscdex just tested it, and I can confirm it worked like a charm on homebrew's build with [email protected]

@mscdex
Copy link
Owner

mscdex commented Mar 16, 2022

Awesome, thanks for the update!

@alexbosworth
Copy link

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

@mscdex
Copy link
Owner

mscdex commented Mar 25, 2022

@alexbosworth What do you mean by "install locally" ?

How did you install node?

What node version are you using?

@alexbosworth
Copy link

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

@mscdex
Copy link
Owner

mscdex commented Mar 25, 2022

FWIW I've installed ssh2 and ran the tests using node v12-v17 via homebrew and there are no symbol errors. Additionally when using the prebuilt node binaries (which bundle OpenSSL) there are no errors there either.

Those were all run on Github's infrastructure, which is currently on macOS 11.6.5.

@mscdex
Copy link
Owner

mscdex commented Mar 25, 2022

Do you get the symbol errors when you run the cpu-features tests?

@alexbosworth
Copy link

If I try it normally on a fresh npm install

node:internal/modules/cjs/loader:1187
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The module '/Users/alex/repos/project/node_modules/cpu-features/build/Release/cpufeatures.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 102. This version of Node.js requires
NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

If I try doing npm rebuild:

dyld[98693]: missing symbol called
zsh: abort      node test.js

@mscdex
Copy link
Owner

mscdex commented Mar 25, 2022

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.

@mscdex
Copy link
Owner

mscdex commented Mar 25, 2022

With node v12-v17 from either homebrew or binaries from nodejs.org, I do not get any symbol errors when running the cpu-features tests.

@alexbosworth
Copy link

alexbosworth commented Mar 25, 2022

I also get the same error dyld[3968]: missing symbol called when doing:

git clone https://github.com/mscdex/cpu-features
npm i
npm t

node -v reports v16.14.2

@alexbosworth
Copy link

The last working commit for me is fc44921355b3f8cbe44c5a9343570360f8aa4d20

@mscdex
Copy link
Owner

mscdex commented Mar 25, 2022

Since we've identified it's definitely coming from cpu-features, then let's take this back to mscdex/cpu-features#7.

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

No branches or pull requests

3 participants