aisha@ identified a rather recent problem with lang/node, as in the following would immediately crash (nevermind the node version. It's 100% reproducible in 7.5 and -current):
$ node Welcome to Node.js v20.12.2. Type ".help" for more information.
require('dns').resolve4('openbsd.org','A',(err, records) => {console.log(records);});
I tracked this back to the following pull request in libcares: https://github.com/c-ares/c-ares/pull/659 Reverting that fixes things ... diff attached, which includes an update to 1.28.1, the version I've been testing with.
Index: Makefile =================================================================== RCS file: /cvs/ports/net/libcares/Makefile,v diff -u -p -r1.28 Makefile --- Makefile 5 Apr 2024 20:38:05 -0000 1.28 +++ Makefile 7 May 2024 23:11:14 -0000 @@ -1,12 +1,12 @@ COMMENT= asynchronous resolver library -V= 1.28.0 +V= 1.28.1 DISTNAME= c-ares-${V} PKGNAME= libcares-${V} CATEGORIES= net devel SITES= ${HOMEPAGE}download/ -SHARED_LIBS += cares 3.6 # 8.1.6 +SHARED_LIBS += cares 3.7 # 8.1.6 HOMEPAGE= https://c-ares.haxx.se/ Index: distinfo =================================================================== RCS file: /cvs/ports/net/libcares/distinfo,v diff -u -p -r1.16 distinfo --- distinfo 5 Apr 2024 20:38:05 -0000 1.16 +++ distinfo 7 May 2024 23:11:14 -0000 @@ -1,2 +1,2 @@ -SHA256 (c-ares-1.28.0.tar.gz) = PJL+u969/p3qDgNwg/VTV3ReDfNCQ/lmDu2HV9thdDA= -SIZE (c-ares-1.28.0.tar.gz) = 1311900 +SHA256 (c-ares-1.28.1.tar.gz) = Z1pp/FTdv0LmgwvGce62zYnuykOCjrQTJD/SwKdggJ0= +SIZE (c-ares-1.28.1.tar.gz) = 1312102 Index: patches/patch-src_lib_ares__socket_c =================================================================== RCS file: patches/patch-src_lib_ares__socket_c diff -N patches/patch-src_lib_ares__socket_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_lib_ares__socket_c 7 May 2024 23:11:14 -0000 @@ -0,0 +1,16 @@ +Index: src/lib/ares__socket.c +--- src/lib/ares__socket.c.orig ++++ src/lib/ares__socket.c +@@ -253,12 +253,6 @@ ares_status_t ares__open_connection(ares_channel_t + struct server_connection *conn; + ares__llist_node_t *node; + int type = is_tcp ? SOCK_STREAM : SOCK_DGRAM; +-#ifdef __OpenBSD__ +- if ((is_tcp && server->tcp_port == 53) || +- (!is_tcp && server->udp_port == 53)) { +- type |= SOCK_DNS; +- } +-#endif + + switch (server->addr.family) { + case AF_INET: