Bug 5379

Summary: sunrpc: Fix hangs in UDP RPC calls
Product: glibc Reporter: Petr Baudis <pasky>
Component: networkAssignee: Not yet assigned to anyone <unassigned>
Status: WAITING ---    
Severity: normal CC: glibc-bugs, mikeh, neleai
Priority: P2 Flags: fweimer: security-
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Attachments: Proposed patch
Proposed patch
Proposed patch

Description Petr Baudis 2007-11-21 03:29:12 UTC
clntudp_call() does not properly implement re-poll()ing in case the poll() has
been interrupted.
Comment 1 Petr Baudis 2007-11-21 03:29:28 UTC
Created attachment 2102 [details]
Proposed patch
Comment 2 Ulrich Drepper 2007-11-23 01:32:46 UTC
The patch is not correct.  It goes to the extreme other side.  Now a few signals
sent in short succession can cause the total timeout time to be far too short.

To fix this it will be necessary to measure how long the poll calls slept and
adjust the total time to this.
Comment 3 Mike Heffner 2008-10-10 19:19:25 UTC
Created attachment 2993 [details]
Proposed patch

Here's a different patch for the same bug. This deducts time spent in poll(2)
for each EINTR and reduces the timeout for the subsequent calls to poll(2).
Warning: This patch should compile but I don't have the ability to test it.

Caveats: No way to distinguish the time spent in the signal handler that
interrupted poll(2) from time actually spent polling.
Comment 4 Mike Heffner 2008-10-10 20:29:50 UTC
Created attachment 2994 [details]
Proposed patch

Updated patch to use larger integer type to store milliseconds.
Comment 5 Ondrej Bilka 2013-10-08 16:36:32 UTC
Now last hunk of patch does not apply. Could you sent updated patch to libc-alpha?