Bug 146345 - recv returns EAGAIN instead of EINTR when interrupted
Summary: recv returns EAGAIN instead of EINTR when interrupted
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Miller
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-01-27 09:18 UTC by Magnus Ihse Bursie
Modified: 2007-11-30 22:07 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-05-18 13:29:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Reproducer. (4.41 KB, text/plain)
2005-01-27 09:19 UTC, Magnus Ihse Bursie
no flags Details
Fix for EAGAIN signal race (1.68 KB, patch)
2005-02-01 05:21 UTC, David Miller
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2005:294 0 normal SHIPPED_LIVE Moderate: Updated kernel packages available for Red Hat Enterprise Linux 3 Update 5 2005-05-18 04:00:00 UTC

Description Magnus Ihse Bursie 2005-01-27 09:18:22 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5)
Gecko/20041107 Firefox/1.0

Description of problem:
Sometimes when recv() is interrupted by a signal (e.g. SIGUSR1), it
returns not EINTR as expected, but EAGAIN. This happens sporadically,
but the attached reproducerar reproduced the problem within a few seconds.


Version-Release number of selected component (if applicable):
kernel-2.4.21-15.EL

How reproducible:
Always

Steps to Reproduce:
1. Run the attached reproducer.
2.
3.
    

Actual Results:  [magnusi@stheng30:~]$ ./test_select_ia64
recv returned EAGAIN, after 132981248 bytes and 80 interrupts
recv returned EAGAIN, after 291813888 bytes and 137 interrupts
recv returned EAGAIN, after 8419840 bytes and 4 interrupts
recv returned EAGAIN, after 6356992 bytes and 3 interrupts
recv returned EAGAIN, after 4243456 bytes and 2 interrupts
... etc

Expected Results:  No output should have been written, since recv
should not have returned EAGAIN.


Additional info:

This only happens on SMP machines. It is confirmed to happen on both
i386 and ia64.

Comment 1 Magnus Ihse Bursie 2005-01-27 09:19:58 UTC
Created attachment 110282 [details]
Reproducer.

Comment 2 David Miller 2005-02-01 05:21:13 UTC
Created attachment 110485 [details]
Fix for EAGAIN signal race

Pretty tight race.  We were returning -EAGAIN when the
recv queue is non-empty.

Comment 3 Ernie Petrides 2005-02-10 03:29:38 UTC
A fix for this problem has just been committed to the RHEL3 U5
patch pool this evening (in kernel version 2.4.21-27.12.EL).


Comment 4 Tim Powers 2005-05-18 13:29:11 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-294.html



Note You need to log in before you can comment on or make changes to this bug.