Assertion failed: (!"unknown EAI_* error code"), function uv__getaddrinfo_translate_error, file src/unix/getaddrinfo.c, line 90. #51262
Labels
libuv
Issues and PRs related to the libuv dependency or the uv binding.
Uh oh!
There was an error while loading. Please reload this page.
Version
16.18.1
Platform
FreeBSD eisy 13.2-RELEASE-p4 FreeBSD 13.2-RELEASE-p4 #9 releng/13.2-n254638-d20ece445acf-dirty: Fri Oct 20 16:50:52 UTC 2023 [email protected]:/usr/obj/usr/src/amd64.amd64/sys/eisy amd64
Subsystem
https://github.com/nodejs/node/blob/main/deps/uv/src/unix/getaddrinfo.c
What steps will reproduce the bug?
node.js crashes randomly with this error. We can not find any way to reproduce it.
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
No response
What do you see instead?
node.js crashes randomly with this error:
Assertion failed: (!"unknown EAI_* error code"), function uv__getaddrinfo_translate_error, file src/unix/getaddrinfo.c, line 90.
Additional information
I believe the error would be caused by a EAI_MAX error
FreeBSD glibc's getaddrinfo() can return a EAI_MAX error, which is not trapped by libuv uv__getaddrinfo_translate_error()
Ref:
getaddrinfo man page says it can return errors from gai_strerror(3)
Freebsd man page: https://man.freebsd.org/cgi/man.cgi?query=getaddrinfo&sektion=3
gai_strerror(3): https://man.freebsd.org/cgi/man.cgi?query=gai_strerror&sektion=3&manpath=FreeBSD+13.2-
RELEASE+and+Ports
When googling around, I can find a reference to EAI_MAX error in netdb.h.
Ref: https://gitea-dev.freebsd.org/FreeBSD/src/src/tag/release/13.1.0/include/netdb.h
In node.js' uv__getaddrinfo_translate_error(), there is a case for all errors, except EAI_MAX
That's the case for node.js 16.18.1 which we are using, but also the main branch too.
Ref: https://github.com/nodejs/node/blob/main/deps/uv/src/unix/getaddrinfo.c
Therefore, we probably need to add:
#if defined(EAI_MAX)
case EAI_MAX: return UV_EAI_MAX;
#endif
And of course UV_EAI_MAX would need to be defined.
The text was updated successfully, but these errors were encountered: