Closed vlm closed 6 years ago
Hm. It's not happening on LInux. Can you run it under debugger and check what the value of "rc" is when the assert happens?
Turns out, the case is easier than I thought.
rc = 24, errno: 24 Too many open files
By default, macOS's limit is 256, hence an earlier error.
However, it shouldn't crash because of that.
Even so, the DNS queries are done one after another, not simultaneously. There should be one fd used. It looks like there's some kind of a leak there.
Running the test under valgrind:
==11105== 64,000 bytes in 1,000 blocks are definitely lost in loss record 6 of 7
==11105== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11105== by 0x41452C: dns_ai_setent (dns.c:7457)
==11105== by 0x414BF2: dns_ai_nextent (dns.c:7577)
==11105== by 0x402536: ipaddr_remote (ipaddr.c:273)
==11105== by 0x4018B4: main (test.c:34)
This was moved to libdill in the meantime and the leak was fixed.
To reproduce in the current
master
:P.S. Mac OS X 10.12, XCode 8.0 (clang-800.0.38).