This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #14719] Return EAI_SYSTEM from getaddrinfo if we run out of fds
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: "Dmitry V. Levin" <ldv at altlinux dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 8 Apr 2013 18:26:53 +0530
- Subject: Re: [PATCH][BZ #14719] Return EAI_SYSTEM from getaddrinfo if we run out of fds
- References: <20121023171835 dot 09f1b085 at spoyarek> <20130325125824 dot GA11387 at altlinux dot org> <CAAHN_R1OWczQtSFVHK3DVdqBg4+qKivxMoN_6gjfxxGiyzYO8A at mail dot gmail dot com> <20130401171156 dot GB9522 at altlinux dot org> <CAAHN_R1yThAuKHrr4cePcmrVo_=vHLf9257OGFsE6v3Oc36s4Q at mail dot gmail dot com> <20130402134937 dot GB3211 at altlinux dot org> <20130408033614 dot GA20503 at altlinux dot org> <20130408052713 dot GB32556 at spoyarek dot pnq dot redhat dot com> <20130408055825 dot GA21873 at altlinux dot org> <20130408063238 dot GG32556 at spoyarek dot pnq dot redhat dot com>
Ugh, I accidentally sent this personally to Dmitry. Sorry.
Siddhesh
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?
>
> Siddhesh
>
> $ strace -econnect,sendmmsg ./t
> connect(4, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
> connect(3, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
> connect(3, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
> connect(3, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
> connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, 16) = 0
> sendmmsg(3, 0x7fff6cb08090, 2, MSG_NOSIGNAL) = -1 EPERM (Operation not permitted)
> connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, 16) = 0
> sendmmsg(3, 0x7fff6cb08090, 2, MSG_NOSIGNAL) = -1 EPERM (Operation not permitted)
> connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, 16) = 0
> sendmmsg(3, 0x7fff6cb08090, 2, MSG_NOSIGNAL) = -1 EPERM (Operation not permitted)
> connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, 16) = 0
> sendmmsg(3, 0x7fff6cb08090, 2, MSG_NOSIGNAL) = -1 EPERM (Operation not permitted)
> Name or service not known: Connection refused
> +++ exited with 0 +++
>
> $ ldd ./t
> linux-vdso.so.1 => (0x00007fffcefd8000)
> libc.so.6 => /tools/src/upstream/glibc/build/libc.so.6 (0x00007ff166258000)
> /tools/src/upstream/glibc/build/elf/ld.so => /lib64/ld-linux-x86-64.so.2 (0x0000003d71c00000)
>
> $ iptables -L
> ....
> Chain OUTPUT (policy ACCEPT)
> target prot opt source destination
> REJECT all -- anywhere anywhere reject-with icmp-net-unreachable
> ....