Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.82k stars 12.48k forks source link

node called missing symbol when using package manager to install #198194

Closed Zylsjsp closed 1 week ago

Zylsjsp commented 2 weeks ago

brew gist-logs <formula> link OR brew config AND brew doctor output

brew config && brew doctor
HOMEBREW_VERSION: 4.4.6-17-gad2e330
ORIGIN: https://github.com/Homebrew/brew
HEAD: ad2e3300260eb43de6c57bb5d21fa724cd10f3c8
Last commit: 16 hours ago
Core tap HEAD: 5406dc1e134c6cd5548f94b136b56305430b67cc
Core tap last commit: 4 weeks ago
Core tap JSON: 19 Nov 09:50 UTC
Core cask tap JSON: 19 Nov 09:50 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.6 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 16.0.0 build 1600
Git: 2.39.5 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.1-arm64
CLT: 16.1.0.0.1.1729049160
Xcode: N/A
Rosetta 2: false
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libsfsandbox.dylib

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  node

Warning: You have uncommitted modifications to Homebrew/homebrew-core.
If this is a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
  cd /opt/homebrew/Library/Taps/homebrew/homebrew-core && git stash -u && git clean -d -f

Uncommitted files:
   M Formula/m/mysql-client.rb

Verification

What were you trying to do (and why)?

run pnpm install -g tsc got dyld[$pid] missing symbol called when downloading

What happened (include all command output)?

attached to lldb and got an traceback of exception:

(lldb) thread backtrace
* thread #13, stop reason = signal SIGABRT
  * frame #0: 0x0000000197ac873c dyld`__abort_with_payload + 8
    frame #1: 0x0000000197acfab4 dyld`abort_with_payload_wrapper_internal + 104
    frame #2: 0x0000000197acfae8 dyld`abort_with_payload + 16
    frame #3: 0x0000000197a691f4 dyld`dyld4::halt(char const*, dyld4::StructuredError const*) + 300
    frame #4: 0x0000000197a9a018 dyld`dyld4::APIs::_dyld_missing_symbol_abort() + 28
    frame #5: 0x0000000100427308 node`node::crypto::Hash::HashDigest(v8::FunctionCallbackInfo<v8::Value> const&) + 240
    frame #6: 0x0000000100016978 node`Builtins_CallApiCallbackGeneric + 152
    frame #7: 0x0000000100014838 node`Builtins_InterpreterEntryTrampoline + 280
    frame #8: 0x0000000100014838 node`Builtins_InterpreterEntryTrampoline + 280
    frame #9: 0x00000001000dea00 node`Builtins_ArrayReduce + 960
    frame #10: 0x0000000100014838 node`Builtins_InterpreterEntryTrampoline + 280
    frame #11: 0x0000000100014838 node`Builtins_InterpreterEntryTrampoline + 280
    frame #12: 0x0000000100014838 node`Builtins_InterpreterEntryTrampoline + 280
    frame #13: 0x0000000100014838 node`Builtins_InterpreterEntryTrampoline + 280
    frame #14: 0x0000000100014838 node`Builtins_InterpreterEntryTrampoline + 280
    frame #15: 0x000000011975b9e0
    frame #16: 0x0000000100014838 node`Builtins_InterpreterEntryTrampoline + 280
    frame #17: 0x000000010001250c node`Builtins_JSEntryTrampoline + 172
    frame #18: 0x00000001000121b0 node`Builtins_JSEntry + 176
    frame #19: 0x00000001005832f0 node`v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 1572
    frame #20: 0x0000000100582c50 node`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>*) + 92
    frame #21: 0x00000001004736e8 node`v8::Function::Call(v8::Isolate*, v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) + 176
    frame #22: 0x00000001001cdbd4 node`node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context, v8::Local<v8::Value>) + 556
    frame #23: 0x00000001001e5b54 node`node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) + 304
    frame #24: 0x0000000100306934 node`node::worker::MessagePort::OnMessage(node::worker::MessagePort::MessageProcessingMode) + 544
    frame #25: 0x0000000104a31cf4 libuv.1.dylib`uv__async_io + 268
    frame #26: 0x0000000104a42114 libuv.1.dylib`uv__io_poll + 1408
    frame #27: 0x0000000104a32184 libuv.1.dylib`uv_run + 268
    frame #28: 0x00000001001ce488 node`node::SpinEventLoopInternal(node::Environment*) + 256
    frame #29: 0x00000001003a528c node`node::worker::Worker::Run() + 1764
    frame #30: 0x00000001003a7d70 node`node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&)::$_0::__invoke(void*) + 56
    frame #31: 0x0000000197de72e4 libsystem_pthread.dylib`_pthread_start + 136

What did you expect to happen?

pnpm install complete with no error.

Step-by-step reproduction instructions (by running brew commands)

On MacOS sequoia 15.1

brew install node pnpm
pnpm install -g tsc

Seems to be an API change, maybe re-compilation needed.

SMillerDev commented 2 weeks ago

What does which pnpm say?

Zylsjsp commented 1 week ago

What does which pnpm say?

/opt/homebrew/bin/pnpm which finally pointed to /opt/homebrew/Cellar/pnpm/9.13.2/libexec/lib/node_modules/pnpm/bin/pnpm.cjs

npm get the same error

Zylsjsp commented 1 week ago

Seems to be Apple's bug. Fixed in Sequoia 15.1.1

Zylsjsp commented 1 week ago

Seems to be Apple's bug. Fixed in Sequoia 15.1.1

My misleading. pnpm install doesn't calculate hash for existing storage, so the issue seemed to vanish. With clean storage the issue occurs again. Newly built out/Release/node works well.

Therefore, seems a rebuild of formula node is essential for MacOS Sequoia.

The issue also reproduces in older tags such as node@22 as long as built for Sequoia arm64

Bo98 commented 1 week ago

0x0000000100427308 is a call to EVP_MD_CTX_get_size_ex. Does the issue still happen after a brew reinstall openssl@3?

Zylsjsp commented 1 week ago

0x0000000100427308 is a call to EVP_MD_CTX_get_size_ex. Does the issue still happen after a brew reinstall openssl@3?

Fixed after reinstall, tks

Zylsjsp commented 1 week ago

Then maybe a hint could help with those who upgraded MacOS from major versions as:

brew list --formulae | xargs brew reinstall

Maybe I should draft a new discussion?

Bo98 commented 1 week ago

While there's a couple of formulae that's expected to need reinstalling on new macOS versions (pkg-config and gcc mainly), the vast majority is expected to work ok, including OpenSSL. Hard to tell though what happened here as this is the only report so far.