From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16038 invoked by alias); 6 Aug 2013 14:26:52 -0000 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 Received: (qmail 15921 invoked by uid 48); 6 Aug 2013 14:26:47 -0000 From: "nicholas at nicholaswilson dot me.uk" To: glibc-bugs@sourceware.org Subject: [Bug nis/15819] New: Hang in getaddrinfo using NIS with setitimer Date: Tue, 06 Aug 2013 14:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: nis X-Bugzilla-Version: 2.13 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nicholas at nicholaswilson dot me.uk X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-08/txt/msg00007.txt.bz2 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.