Bug 146345 - recv returns EAGAIN instead of EINTR when interrupted
recv returns EAGAIN instead of EINTR when interrupted
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: David Miller
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-27 04:18 EST by Magnus Ihse Bursie
Modified: 2007-11-30 17:07 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-18 09:29:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Magnus Ihse Bursie 2005-01-27 04:18:22 EST
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 04:19:58 EST
Created attachment 110282 [details]
Reproducer.
Comment 2 David Miller 2005-02-01 00:21:13 EST
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-09 22:29:38 EST
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 09:29:11 EDT
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.