This is the mail archive of the
mailing list for the glibc project.
[Bug libc/12224] New: getaddrinfo() fails permanently when no network on first call.
- From: "jim.duchek at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Wed, 17 Nov 2010 19:00:42 +0000
- Subject: [Bug libc/12224] New: getaddrinfo() fails permanently when no network on first call.
- Auto-submitted: auto-generated
Summary: getaddrinfo() fails permanently when no network on
Created attachment 5125
Repeated getaddrinfo call
When getaddrinfo() is called for the first time (on a per-thread basis) with no
network available, it returns -EAGAIN (which is probably an issue in and of
itself, as it's not necessarily a 'temporary problem). Repeated calls to
getaddrinfo() will _always_ return -EAGAIN, even after network access is
If getaddrinfo() succeeds the first time, and then the network is removed, it
will fail (as expected), but will return to functional after the network is
It appears that despite having getaddrinfo() in permanent-fail mode on one
thread, spawning a new thread (assuming the network is up on first-call) will
have a functional getaddrinfo()
To reproduce (see attached short program):
gcc -o getaddrinfo_test getaddrinfo_test.c
/etc/rc.d/network stop (or click the networkmanager icon, or whatever -- just
kill the network)
./getaddrinfo_test (will repeatedly show -3)
in another window, restart the network
the 'getaddrinfo_test' output will continue to output -3 indefinitely.
Any temporary workaround to 'reset' getaddrinfo() would be appreciated as well.
I tracked this here from python -- it pretty much kills urllib2 if your
program is started before the network is up (say, on a laptop). Filing this as
critical because it seems to break a number of applications that start on login
on a laptop (where the network doesn't come up until after login), as no amount
of 'retries' will help it work.
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.