Bug 119908 - sigwait() returns error, man page claims it does not.
Summary: sigwait() returns error, man page claims it does not.
Keywords:
Status: CLOSED NOTABUG
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: Ingo Molnar
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-04-03 01:29 UTC by John DeFranco
Modified: 2007-11-30 22:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-09-15 17:00:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description John DeFranco 2004-04-03 01:29:58 UTC
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 08:21:44 UTC
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 21:10:19 UTC
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 06:45:46 UTC
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 12:52:20 UTC
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.