From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24850 invoked by alias); 14 Oct 2012 15:56:30 -0000 Received: (qmail 24739 invoked by uid 48); 14 Oct 2012 15:56:12 -0000 From: "robryk+bugzilla at gmail dot com" To: glibc-bugs@sources.redhat.com Subject: [Bug network/14719] New: getaddrinfo() returns EAI_NONAME when out of file descriptors Date: Sun, 14 Oct 2012 15:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: network X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: robryk+bugzilla at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2012-10/txt/msg00154.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14719 Bug #: 14719 Summary: getaddrinfo() returns EAI_NONAME when out of file descriptors Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: network AssignedTo: unassigned@sourceware.org ReportedBy: robryk+bugzilla@gmail.com Classification: Unclassified When getaddrinfo(host, NULL) is called with the fd limit exhausted, it returns EAI_NONAME. I would expect it to return EAI_SYSTEM or EAI_AGAIN. I've checked version 2.16 and repository HEAD; they both behave that way. The following program demonstrates the issue (when the fd limit is set): #include #include #include #include #include #include #include int main() { int fd; do { fd = open("/dev/null", O_RDONLY); } while (fd != -1); struct addrinfo* res; int err = getaddrinfo("google.com", NULL, NULL, &res); printf("%s\n", gai_strerror(err)); return 0; } This also happens if I do a successful lookup beforehand (in which case, if I understand correctly, configuration from nsswitch.conf and proper libnss_* libraries are already loaded). I suspect that at least part of this issue stems from behavior of _nss_dns_gethostbyname4_r, which returns NSS_STATUS_NOTFOUND, even though h_errno is set to TRY_AGAIN in __libc_res_nsearch. -- 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.