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

Node 20.13+: Crash on getaddrinfo_0_11 #266

Open
nbonamy opened this issue Jul 28, 2024 · 3 comments
Open

Node 20.13+: Crash on getaddrinfo_0_11 #266

nbonamy opened this issue Jul 28, 2024 · 3 comments

Comments

@nbonamy
Copy link

nbonamy commented Jul 28, 2024

I get a crash when I create a browser: const browser = mdns.createBrowser(mdns.tcp('http)).

The error displayed is:

  #  node[6452]: void node::cares_wrap::{anonymous}::GetAddrInfo(const v8::FunctionCallbackInfo<v8::Value>&) at ../src/cares_wrap.cc:1575
  #  Assertion failed: args[4]->IsUint32()

----- Native stack trace -----

 1: 0xcba1e7 node::Assert(node::AssertionInfo const&) [node]
 2: 0xbe78aa  [node]
 3: 0xf562bf v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [node]
 4: 0xf56b2d  [node]
 5: 0xf56ff5 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
 6: 0x1961df6  [node]

----- JavaScript stack trace -----

1: getaddrinfo_0_11 (/home/mnmt/src/tidal_streamer/node_modules/mdns/lib/resolver_sequence_tasks.js:117:21)
2: /home/mnmt/src/tidal_streamer/node_modules/mdns/lib/resolver_sequence_tasks.js:153:7
3: getaddrinfo (/home/mnmt/src/tidal_streamer/node_modules/mdns/lib/resolver_sequence_tasks.js:152:14)
4: next (/home/mnmt/src/tidal_streamer/node_modules/mdns/lib/browser.js:109:21)
5: on_resolver_done (/home/mnmt/src/tidal_streamer/node_modules/mdns/lib/resolver_sequence_tasks.js:33:11)
6: MDNSService.self.watcher.callback (/home/mnmt/src/tidal_streamer/node_modules/mdns/lib/mdns_service.js:18:40)


Aborted (core dumped)

The crash occurs when trying to resolve a local network host: pifi.local. which exists and is resolvable:

$ ping pifi.local.
PING pifi.local. (192.168.1.9) 56(84) bytes of data.
64 bytes from 192.168.1.9 (192.168.1.9): icmp_seq=1 ttl=64 time=1.62 ms

I tried to add a resolverSequence to no avail:

resolverSequence: [
  mdns.rst.DNSServiceResolve(),
  'DNSServiceGetAddrInfo' in mdns.dns_sd ? mdns.rst.DNSServiceGetAddrInfo() : mdns.rst.getaddrinfo({families:[4]}),
  mdns.rst.makeAddressesUnique()
]

Running node 20.16 on Linux Mint 21 Vanessa.

Any hint? Thinking of a IPv4 vs IPv6 thing but not sure.

Thanks!

@nbonamy
Copy link
Author

nbonamy commented Jul 28, 2024

Even tried a nom rebuild with no change:

$ npm rebuild --verbose
npm verbose cli /usr/bin/node /usr/bin/npm
npm info using npm@10.8.1
npm info using node@v20.16.0
npm verbose title npm rebuild
npm verbose argv "rebuild" "--loglevel" "verbose"
npm verbose logfile logs-max:10 dir:/home/.../.npm/_logs/2024-07-28T02_58_41_575Z-
npm verbose logfile /home/.../.npm/_logs/2024-07-28T02_58_41_575Z-debug-0.log
npm verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules/mdns
npm info run mdns@2.7.2 install node_modules/mdns node-gyp rebuild
npm info run mdns@2.7.2 install { code: 0, signal: null }
rebuilt dependencies successfully
npm verbose cwd /home/....
npm verbose os Linux 5.15.0-116-generic
npm verbose node v20.16.0
npm verbose npm  v10.8.1
npm verbose exit 0
npm info ok

@nbonamy
Copy link
Author

nbonamy commented Jul 28, 2024

@nbonamy
Copy link
Author

nbonamy commented Jul 28, 2024

Confirmed. According to nodejs/node#52492 this was merged in Node 20.13 and 22.1.

Rolled back Node to 20.12.2 and the crash disappeared!

@nbonamy nbonamy changed the title Crash on getaddrinfo_0_11 Node 20.13+: Crash on getaddrinfo_0_11 Jul 29, 2024
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

1 participant