This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/12224] New: getaddrinfo() fails permanently when no network on first call.

           Summary: getaddrinfo() fails permanently when no network on
                    first call.
           Product: glibc
           Version: 2.12
            Status: NEW
          Severity: critical
          Priority: P2
         Component: libc

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:
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]