I did this
Version: curl 8.12 tarball from most recent github tag
Observed:
$ autoreconf -fi && ./configure --with-openssl --enable-ipv6 && make
[…]
CC ../lib/curl-version_win32.o
CC ../lib/curl-warnless.o
echo 'extern const void *curl_ca_embed; const void *curl_ca_embed;' > tool_ca_embed.c
HUGE tool_hugehelp.c
CC curl-tool_ca_embed.o
CC curl-tool_hugehelp.o
CCLD curl
make[1]: Leaving directory '/home/ej/curl-curl-8_12_0/src'
Making all in scripts
make[1]: Entering directory '/home/ej/curl-curl-8_12_0/scripts'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ej/curl-curl-8_12_0/scripts'
make[1]: Entering directory '/home/ej/curl-curl-8_12_0'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/home/ej/curl-curl-8_12_0'
ej@a4:~/curl-curl-8_12_0$ ./src/curl inai.de
curl: (6) Could not resolve host: inai.de
ej@a4:~/curl-curl-8_12_0$ libtool --mode=execute gdb src/curl
(gdb) b getaddrinfo
(gdb) r inai.de
[…]
Thread 2 "curl" hit Breakpoint 1, __GI_getaddrinfo (name=0x47aa00 "inai.de", service=0xf6d65f14 "80", hints=0x47bc84, pai=0xf6d65ec0)
at ./nss/getaddrinfo.c:2297
warning: 2297 ./nss/getaddrinfo.c: No such file or directory
(gdb) fin
Run till exit from #0 __GI_getaddrinfo (name=0x47aa00 "inai.de", service=0xf6d65f14 "80", hints=0x47bc84, pai=0xf6d65ec0)
at ./nss/getaddrinfo.c:2297
0xf7ecf079 in Curl_getaddrinfo_ex (nodename=0x47aa00 "inai.de", servname=0xf6d65f14 "80", hints=0x47bc84, result=0x47bc80)
at curl_addrinfo.c:121
121 error = getaddrinfo(nodename, servname, hints, &aihead);
Value returned is $1 = 0
(gdb) p aihead[0]
$2 = {ai_flags = 0, ai_family = 10, ai_socktype = 1, ai_protocol = 6, ai_addrlen = 28, ai_addr = 0xf64008a0, ai_canonname = 0x0,
ai_next = 0xf6400840}
(gdb) p aihead[0].ai_next[0]
$3 = {ai_flags = 0, ai_family = 2, ai_socktype = 1, ai_protocol = 6, ai_addrlen = 16, ai_addr = 0xf6400860, ai_canonname = 0x0,
ai_next = 0x0}
getaddrinfo in thread2 even succeeds, but it appears the dnscache in thread1 remains empty (h->table = NULL).
multi_runsingle (multi=0x47b970, nowp=0xffffd9a0, data=0x4800b0) at multi.c:2346
2346 struct Curl_message *msg = NULL;
(gdb) n
2348 bool protocol_connected = FALSE;
(gdb)
2349 bool dophase_done = FALSE;
(gdb)
2351 CURLcode result = CURLE_OK;
(gdb)
2354 if(!GOOD_EASY_HANDLE(data))
(gdb)
2357 if(multi->dead) {
(gdb)
2371 bool stream_error = FALSE;
(gdb)
2372 rc = CURLM_OK;
(gdb)
2374 if(multi_ischanged(multi, TRUE)) {
(gdb)
2379 if(data->mstate > MSTATE_CONNECT &&
(gdb)
2380 data->mstate < MSTATE_COMPLETED) {
(gdb)
2379 if(data->mstate > MSTATE_CONNECT &&
(gdb)
2383 if(!data->conn)
(gdb)
2389 if((data->mstate >= MSTATE_CONNECT) && (data->mstate < MSTATE_COMPLETED) &&
(gdb)
2390 multi_handle_timeout(data, nowp, &stream_error, &result))
(gdb)
2389 if((data->mstate >= MSTATE_CONNECT) && (data->mstate < MSTATE_COMPLETED) &&
(gdb)
2394 switch(data->mstate) {
(gdb)
2428 rc = state_resolving(multi, data, &stream_error, &result);
(gdb) s
state_resolving (multi=0x47b970, data=0x4800b0, stream_errorp=0xffffd8bf, resultp=0xffffd8c4) at multi.c:2219
2219 struct Curl_dns_entry *dns = NULL;
(gdb) n
2220 struct connectdata *conn = data->conn;
(gdb)
2222 CURLcode result = CURLE_OK;
(gdb)
2223 CURLMcode rc = CURLM_OK;
(gdb)
2227 if(conn->bits.httpproxy)
(gdb)
2231 if(conn->bits.conn_to_host)
(gdb)
2234 hostname = conn->host.name;
(gdb)
2237 dns = Curl_fetch_addr(data, hostname, conn->primary.remote_port);
(gdb) s
Curl_fetch_addr (data=0x4800b0, hostname=0x479b70 "inai.de", port=80) at hostip.c:360
360 struct Curl_dns_entry *dns = NULL;
(gdb) n
362 if(data->share)
(gdb)
363 Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
(gdb)
365 dns = fetch_addr(data, hostname, port);
(gdb) s
fetch_addr (data=0x4800b0, hostname=0x479b70 "inai.de", port=80) at hostip.c:280
280 struct Curl_dns_entry *dns = NULL;
(gdb) n
284 size_t entry_len = create_hostcache_id(hostname, 0, port,
(gdb) n
288 dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len + 1);
(gdb) s
Curl_hash_pick (h=0x47d630, key=0xffffd700, key_len=11) at hash.c:199
199 if(h->table) {
(gdb) n
212 return NULL;
(gdb)
213 }
I expected the following
succeed, given DNS is functioning properly.
ej@a4:~/curl-curl-8_12_0$ getent hosts inai.de
2a01:4f8:202:600a::a3 inai.de
curl/libcurl version
https://github.com/curl/curl/archive/refs/tags/curl-8_12_0.tar.gz
operating system
ej@a4:~/curl-curl-8_12_0$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux trixie/sid"
NAME="Debian GNU/Linux"
VERSION_CODENAME=trixie
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
ej@a4:~/curl-curl-8_12_0$ cat /etc/apt/sources.list
deb https://deb.debian.org/debian-ports sid main
deb-src http://ftp.debian.org/debian sid main contrib non-free
ej@a4:~/curl-curl-8_12_0$ uname -a
Linux a4 6.13.0 #6 SMP PREEMPT_DYNAMIC Sat Jan 25 14:29:25 CET 2025 x86_64 GNU/Linux
ej@a4:~/curl-curl-8_12_0$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnux32/14/lto-wrapper
Target: x86_64-linux-gnux32
Configured with: ../src/configure -v --with-pkgversion='Debian 14.2.0-16' --with-bugurl=file:///usr/share/doc/gcc-14/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-14 --program-prefix=x86_64-linux-gnux32- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-abi=mx32 --with-multilib-list=mx32,m64,m32 --enable-multilib --enable-checking=release --build=x86_64-linux-gnux32 --host=x86_64-linux-gnux32 --target=x86_64-linux-gnux32
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.0 (Debian 14.2.0-16)
I did this
Version: curl 8.12 tarball from most recent github tag
Observed:
getaddrinfo in thread2 even succeeds, but it appears the dnscache in thread1 remains empty (h->table = NULL).
I expected the following
succeed, given DNS is functioning properly.
curl/libcurl version
https://github.com/curl/curl/archive/refs/tags/curl-8_12_0.tar.gz
operating system