Bug 119908 - sigwait() returns error, man page claims it does not.
sigwait() returns error, man page claims it does not.
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ingo Molnar
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-02 20:29 EST by John DeFranco
Modified: 2007-11-30 17:07 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-15 13:00:43 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)

  None (edit)
Description John DeFranco 2004-04-02 20:29:58 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030630

Description of problem:
The man page for sigwait() claims it will never return an error.
However I have a multi-threaded program that uses sigwait() and
occasionally an error of 4 (interrupted system call) is returned. This
is very hard to reproduce and does only happen rarely but according to
the doc we should not be getting errors from sigwait().

Version-Release number of selected component (if applicable):
glibc-2.3.2-95.6

How reproducible:
Sometimes

Steps to Reproduce:
1. Unfortunately I don't have a standalone test for this.
2.
3.
    

Additional info:
Comment 1 Jakub Jelinek 2004-04-03 03:21:44 EST
Well, the definite source is the standard, not man page.
Where I see:
http://www.opengroup.org/onlinepubs/007904975/functions/sigwait.html
lists at least EINVAL as allowed error.
Plus:
http://www.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_03.html
   Implementations may support additional errors not included in this list, may generate errors included in this list under
   circumstances other than those described here, or may contain extensions or limitations that prevent some errors from
   occurring. The ERRORS section on each reference page specifies whether an error shall be returned, or whether it may be
   returned. Implementations shall not generate a different error number from the ones described here for error conditions
   described in this volume of IEEE Std 1003.1-2001, but may generate additional errors unless explicitly disallowed for a
   particular function.
and sigwait description doesn't seem to explicitely disallow other
errors.
Comment 2 Roland McGrath 2004-04-05 17:10:19 EDT
EINTR is specifically disallowed when not explicitly listed, for
functions in the Threads option.  However, sigwait is not part of that
option, so the general clause Jakub cited does apply and the standard
permits returning EINTR here.  It is reasonable to expect that this
will only occur when an unblocked signal arrived and was handled
without sigwait returning that signal.  If there is a problem here, it
is a kernel problem.  But it would require a reproducing program to
indicate whether the circumstances indicated a bug or a permissible
behavior.
Comment 3 Ulrich Drepper 2004-05-28 02:45:46 EDT
Reassigned to kernel, sigwait in libc is nothing but a little wrapper.

The kernel people can decide whether they want to close it as NOTABUG
or look into changing the kernel to never return EINTR which is not
required.
Comment 5 Trond Eivind Glomsrød 2005-04-08 08:52:20 EDT
The documentation should be updated to reflect a possible non-zero return code,
though.

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