Your message dated Sat, 06 Jun 2026 06:04:15 +0000
with message-id <[email protected]>
and subject line Bug#862594: fixed in libasyncns 0.8-8
has caused the Debian Bug report #862594,
regarding libasyncns0: libasyncns using pthreads blocks until workers die on
free()
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
862594: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=862594
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libasyncns0
Severity: normal
Tags: patch upstream
Hello,
Forwarding here this bug, since there's no any action from upstream:
https://bugs.freedesktop.org/show_bug.cgi?id=94849
When using libasyncns with pthreads support, it freezes entire
application, when you try to asyncns_free() instance, that have one of
its workers blocked by getaddrinfo() (worker may be blocked eg. because
of some problem with resolver servers).
An easy way to reproduce this bug is to set your nameserver in
resolv.conf to something non-existent (like 1.2.3.4), then create
asyncns resolver, make a request, and then immediately asyncns_free()
resolver. It will block the application, until worker gets network
timeout.
The problem, as I see it, lies in this code (in asyncns_free()):
/* Now terminate them and wait until they are gone. */
for (p = 0; p < asyncns->valid_workers; p++) {
#ifndef HAVE_PTHREAD
kill(asyncns->workers[p], SIGTERM);
for (;;) {
if (waitpid(asyncns->workers[p], NULL, 0) >= 0 || errno != EINTR)
break;
}
#else
for (;;) {
if (pthread_join(asyncns->workers[p], NULL) != EINTR)
break;
}
#endif
}
So, when pthreads are not in use, it kill()'s worker, then wait()'s for
it. When they are used - it just pthread_join()'s them, which, AFAICS,
is equal to just wait(). I'm no expert on threading, but I've found,
that pthread_cancel() just before waiting cycle solves this problem.
Please, consider including this fix (or any other, that resolves the
problem) into the upstream.
Patch, that fixes the problem for me (not sure, how to attach the file
in reportbug, thus inserting plaintext):
--- a/libasyncns/asyncns.c 2016-03-19 19:13:00.774406379 +0200
+++ b/libasyncns/asyncns.c 2016-03-19 19:13:02.378415461 +0200
@@ -865,6 +865,7 @@
break;
}
#else
+ pthread_cancel(asyncns->workers[p]);
for (;;) {
if (pthread_join(asyncns->workers[p], NULL) != EINTR)
break;
-- System Information:
Debian Release: 9.0
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64
(x86_64)
Foreign Architectures: i386
Kernel: Linux 4.9.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=uk_UA.UTF-8, LC_CTYPE=uk_UA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
--- End Message ---
--- Begin Message ---
Source: libasyncns
Source-Version: 0.8-8
Done: Jayen Ashar <[email protected]>
We believe that the bug you reported is fixed in the latest version of
libasyncns, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Jayen Ashar <[email protected]> (supplier of updated libasyncns package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Sat, 06 Jun 2026 09:33:47 +1000
Source: libasyncns
Architecture: source
Version: 0.8-8
Distribution: unstable
Urgency: medium
Maintainer: Jayen Ashar <[email protected]>
Changed-By: Jayen Ashar <[email protected]>
Closes: 862594 862596 1123614
Changes:
libasyncns (0.8-8) unstable; urgency=medium
.
[ Jayen Ashar ]
* New maintainer (Closes: #1123614).
* Apply equality_in_assert.patch — fixes assignment-instead-of-comparison
in two asserts (Closes: #862596).
* Apply pthreads.patch — pthread_cancel before pthread_join so a blocked
worker no longer freezes asyncns_free() (Closes: #862594).
* Add Forwarded: header to both new patches (point at the upstream
freedesktop bugs cited in Origin).
* d/watch: switch URL to https.
* d/upstream/metadata: add DEP-12 stub.
* Standards-Version: 4.7.4. (Removed Priority field)
* d/watch: match upstream's absolute http:// tarball links and
downloadurlmangle the fetch to https. The https-only pattern matched
nothing on the index page, which failed the Salsa CI test-uscan job.
.
[ Andreas Tille ]
* d/watch: version=5
* lintian-overrides for false positive debian-watch-uses-insecure-uri
Checksums-Sha1:
5a405f8d816fd14d7e5eaa30129873b3dc861810 1944 libasyncns_0.8-8.dsc
7f92ab601a9b6b2a6063a53806a1243f8c59a1b0 5780 libasyncns_0.8-8.debian.tar.xz
98ed58b2e077a40a45dc932e3b7a558c32e05f5f 6473 libasyncns_0.8-8_amd64.buildinfo
Checksums-Sha256:
f1c6736238bba3b3469bf1af18c5ebdde62bf35ee890921b9c8f85c46c5d34d0 1944
libasyncns_0.8-8.dsc
e85395eb741d4181078fff150fc3f36002a2cc5e6d9072657bcd6f806a955e67 5780
libasyncns_0.8-8.debian.tar.xz
d97f7a4cfe43a9d4d3492a7770103ab7c1c838587e8acb3e03aea0a0f7008f5a 6473
libasyncns_0.8-8_amd64.buildinfo
Files:
f5dc7d06c66cba9ba014339ed810dadc 1944 libs optional libasyncns_0.8-8.dsc
e69708e5eddf4704bd6cfa0c107c09cf 5780 libs optional
libasyncns_0.8-8.debian.tar.xz
8ba772c249e0140b1f52a7b49ebecea5 6473 libs optional
libasyncns_0.8-8_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iQJFBAEBCgAvFiEE8fAHMgoDVUHwpmPKV4oElNHGRtEFAmojtM4RHHRpbGxlQGRl
Ymlhbi5vcmcACgkQV4oElNHGRtGFYQ/+L7DU1lpqmz408CK53aA2ul47tmx9eGCb
H4O6l0XnAI49Saqkmu+hflkL5wk64+lS6t0IBGfByab5NX9rUzfjt5HO0nqyL8uR
lu25SS9rcAv9sEdaR7r0QI5aKL6+vU2eq72sjmVQwia+aPfLEEjdBYcSlTsPNYeQ
kFmC8LxIQsWC3qlPm8zC0i52Kl84HWUuwTFKKYeUHzEPT6MsCcxLTxg6wp5ErE0A
qfo03LVWQFw2phvKTuUYDbF6gTs1VsdhtTngdVQToO0wQysTAUF3+HkokmsNAD8W
yOs5MZcAmGTblsJTasgNl7PlK9H0ATsXICtKxHLayYhKzIDNe4BllZnGRNZ0D2lp
x35vrtyerq9+o+dX0npxQHjimkiA3850VxFXj6c7IGugd/ygSEuJAQL3PzHbnbxz
tJlLjW1i0UVCJazpwJbuq4zuX9zFdMTTdA/Nf/8lhO0v9c78wazyhQHud2Hf7Ir6
yNG5PUQ6OLybQhIxbCgTXIotInlc3GV4EvmG6V/h7QCjWf+Si2czNsipyjbeR6/L
KPoGuU5Zpj9dPEfnEpNW5CicwRIzKC7WJr2Aeimlgru+rDmUHVFJcASOwT2aXGjK
YuYKcCZ2RIzR2bchXy9Ul8kd/rtqvRGIaT3BbPbWHdEm1tUHGifm7/oncdZLS+Uv
iK/jM/W4kaE=
=K6bR
-----END PGP SIGNATURE-----
pgpPdpipiWbEv.pgp
Description: PGP signature
--- End Message ---