[PATCH][BZ #14719] Return EAI_SYSTEM from getaddrinfo if we run out of fds
Dmitry V. Levin
ldv@altlinux.org
Mon Apr 8 21:34:00 GMT 2013
On Mon, Apr 08, 2013 at 12:02:38PM +0530, Siddhesh Poyarekar wrote:
> On Mon, Apr 08, 2013 at 09:58:26AM +0400, Dmitry V. Levin wrote:
> >
> > But if sendto fails with EPERM, getaddrinfo returns EAI_SYSTEM with errno
> > set to EAGAIN.
>
> OK, again I cannot reproduce this - I don't have the nss_myhostname
> module anymore, so that couldn't be the problem this time. I get an
> ECONNREFUSED and not EAGAIN, which is the difference. The other (more
> relevant I'd think) difference is sendmmsg vs sendto - are you running
> an older kernel? Is there some additional configuration you're doing?
The configuration is essentially a bare chroot without additional
configuration, the kernel is 3.8.6. send_dg doesn't call sendmmsg because
of buf2 == NULL.
I did some debugging to find out the order of events:
- in send_dg, sendto fails with errno set to EPERM;
- __libc_res_nsend, after 4 failed send_dg calls, returns with errno set to ECONNREFUSED;
- __libc_res_nquery returns with h_errno set to TRY_AGAIN;
- __libc_res_nquerydomain returns the same;
- __libc_res_nsearch returns the same;
- _nss_dns_gethostbyname3_r returns NSS_STATUS_UNAVAIL with errno set to EAGAIN;
- _nss_dns_gethostbyname2_r returns the same;
- __gethostbyname2_r returns with h_errno set to NETDB_INTERNAL;
- gaih_inet, seeing NETDB_INTERNAL, returns -EAI_SYSTEM.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20130408/ce58e2d9/attachment.sig>
More information about the Libc-alpha
mailing list