public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nis/15819] New: Hang in getaddrinfo using NIS with setitimer
@ 2013-08-06 14:26 nicholas at nicholaswilson dot me.uk
2014-06-13 13:14 ` [Bug nis/15819] " fweimer at redhat dot com
2014-10-31 4:34 ` aoliva at sourceware dot org
0 siblings, 2 replies; 3+ messages in thread
From: nicholas at nicholaswilson dot me.uk @ 2013-08-06 14:26 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=15819
Bug ID: 15819
Summary: Hang in getaddrinfo using NIS with setitimer
Product: glibc
Version: 2.13
Status: NEW
Severity: normal
Priority: P2
Component: nis
Assignee: unassigned at sourceware dot org
Reporter: nicholas at nicholaswilson dot me.uk
CC: kukuk at suse dot de
We call getaddrinfo inside our Xorg module. Xorg unfortunately uses setitimer
to generate recurring SIGALRM notifications, at 20ms intervals. This can cause
various calls to libc to hang.
This is a typical stack trace:
#0 0xffffe402 in __kernel_vsyscall ()
#1 0x00960e6d in poll () from /lib/tls/i686/nosegneg/libc.so.6
#2 0x0098e431 in clntudp_call () from /lib/tls/i686/nosegneg/libc.so.6
#3 0x00b49f84 in do_ypcall () from /lib/libnsl.so.1
#4 0x00b4a6c0 in yp_match () from /lib/libnsl.so.1
#5 0xf77aa351 in internal_gethostbyname2_r () from /lib/libnss_nis.so.2
#6 0x009809bb in gethostbyname2_r@@GLIBC_2.1.2 () from
/lib/tls/i686/nosegneg/libc.so.6
#7 0x0094f4ea in gaih_inet () from /lib/tls/i686/nosegneg/libc.so.6
#8 0x00952c2d in getaddrinfo () from /lib/tls/i686/nosegneg/libc.so.6
The issue is that clntudp_call retries calls to poll() with every EINTR, but
does not adjust the timeout.
See sunrpc/clnt_udp.c:L403. poll() is called repeatedly with the same timeout;
we want clntudp_call() to eventually return within utimeout seconds, but when
setitemer is using a shorter timeout, clntudp_call loops forever.
The fix is to adjust the timeout to poll each time we loop. (This is the normal
way to handle EINTR with timeouts.)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug nis/15819] Hang in getaddrinfo using NIS with setitimer
2013-08-06 14:26 [Bug nis/15819] New: Hang in getaddrinfo using NIS with setitimer nicholas at nicholaswilson dot me.uk
@ 2014-06-13 13:14 ` fweimer at redhat dot com
2014-10-31 4:34 ` aoliva at sourceware dot org
1 sibling, 0 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2014-06-13 13:14 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=15819
Florian Weimer <fweimer at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Flags| |security-
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug nis/15819] Hang in getaddrinfo using NIS with setitimer
2013-08-06 14:26 [Bug nis/15819] New: Hang in getaddrinfo using NIS with setitimer nicholas at nicholaswilson dot me.uk
2014-06-13 13:14 ` [Bug nis/15819] " fweimer at redhat dot com
@ 2014-10-31 4:34 ` aoliva at sourceware dot org
1 sibling, 0 replies; 3+ messages in thread
From: aoliva at sourceware dot org @ 2014-10-31 4:34 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=15819
Alexandre Oliva <aoliva at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |aoliva at sourceware dot org
Assignee|unassigned at sourceware dot org |aoliva at sourceware dot org
--- Comment #1 from Alexandre Oliva <aoliva at sourceware dot org> ---
Created attachment 7871
--> https://sourceware.org/bugzilla/attachment.cgi?id=7871&action=edit
patch to fix the problem
The problem is not limited to nis or udp rpc; there are various parts of glibc
that retry polls without recomputing timeouts. I'm testing this patch to fix
them all.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-31 4:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-06 14:26 [Bug nis/15819] New: Hang in getaddrinfo using NIS with setitimer nicholas at nicholaswilson dot me.uk
2014-06-13 13:14 ` [Bug nis/15819] " fweimer at redhat dot com
2014-10-31 4:34 ` aoliva at sourceware dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).