Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000594 [1003.1(2008)/Issue 7] Base Definitions and Headers Editorial Clarification Requested 2012-07-17 08:00 2019-06-10 08:55
Reporter Konrad_Schwarz View Status public  
Assigned To ajosey
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Konrad Schwarz
Organization Siemens AG
User Reference siginfo_t si_status
Section XBD headers <signal.h>
Page Number 334
Line Number 11164
Interp Status Approved
Final Accepted Text See Note: 0001317
Summary 0000594: Clarify interaction of si_status and WIF* macros
Description I and apparently others misunderstood the si_status member to have the same encoding as the stat_val of wait().
Desired Action Change the definition of si_status in the table headed by
"In addition, the following signal-specific information shall be available:" to

If si_code is equal to CLD_EXITED, then si_status is equal to the exit value of the process; otherwise, it is equal to the signal that caused the process to change state.

This text is taken from a Solaris man page.

Tags tc2-2008
Attached Files

- Relationships
related to 0000690Closed 1003.1(2013)/Issue7+TC1 clarify behavior when calling waitpid with SA_NOCLDWAIT 
parent of 0000947Appliedajosey 1003.1(2008)/Issue 7 Shell should not have $? == 0 for exit(256) 
has duplicate 0000597Closedajosey 1003.1(2008)/Issue 7 exit() incorrectly claims that the exit code is masked by 0377 

-  Notes
(0001316)
nick (manager)
2012-07-26 16:27
edited on: 2012-08-09 10:38

N.B. This response is superseded by Note: 0001317

Interpretation response
------------------------
The standard is unclear on this issue, and no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor.

Rationale:
-------------
None.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------


At p 334 line 11164
Change the "Value" for "int si_status" to
If si_code is equal to CLD_EXITED, then si_status holds 
the least significant eight bits of the exit value of 
the process (with the remaining bits unspecified);
otherwise, it is equal to the signal that caused the 
process to change state.


(0001317)
geoffclare (manager)
2012-08-02 17:16
edited on: 2012-08-08 15:21

Interpretation response
------------------------

The standard is clear that si_status contains an exit value
or a signal; it is not encoded in the same manner as the status
returned by wait(). However, the standard is unclear about when
si_status contains an exit status and when it contains a signal,
and no conformance distinction can be made between alternative
implementations based on this. This is being referred to the
sponsor.

Rationale:
-------------
None.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------

At page 334 line 11164
Change the "Value" for "int si_status" to

    If si_code is equal to CLD_EXITED, then si_status holds
    the exit value of the process; otherwise, it is equal to the
    signal that caused the process to change state. The exit
    value in si_status shall be equal to the full exit value
    (that is, the value passed to _exit(), _Exit() or exit(), or
    returned from main()); it shall not be limited to the least
    significant eight bits of the value.

Cross-volume changes to XSH...

At page 545 line 18913 section _Exit()
and page 785 line 26213 section exit() change:

    the least significant 8 bits (that is, status & 0377) shall be
    available to a waiting parent process

to:

    the least significant 8 bits (that is, status & 0377) shall be
    available from wait() and waitpid(); the full value shall
    be available from waitid() and in the siginfo_t passed to a
    signal handler for SIGCHLD.
    
At page 545 line 18925 section _Exit() change:

    If the parent process of the calling process is executing a wait(),
    waitid(), or waitpid(), [XSI]and has neither set its SA_NOCLDWAIT
    flag nor set SIGCHLD to SIG_IGN,[/XSI] it shall be notified of
    termination of the calling process and the low-order eight bits
    (that is, bits 0377) of status shall be made available to it. If
    the parent is not waiting, the child’s status shall be made
    available to it when the parent subsequently executes wait(),
    waitid(), or waitpid().

    The semantics of the waitid() function shall be equivalent to wait().

to:

    If the parent process of the calling process is executing a wait(),
    waitid(), or waitpid(), [XSI]and has neither set its SA_NOCLDWAIT
    flag nor set SIGCHLD to SIG_IGN,[/XSI] it shall be notified of
    termination of the calling process and the child's status shall be
    made available to it. If the parent is not waiting, the child’s
    status shall be made available to it when the parent subsequently
    executes wait(), waitid(), or waitpid().

At page 545 line 18936 section _Exit() delete:

    The semantics of the waitid() function shall be equivalent to wait().

(0001318)
eblake (manager)
2012-08-08 12:09

I asked various Linux kernel hackers, and got this response from Adam Jackson:
I can't think of a reason that 32-bit exit statuses would be problematic for the kernel offhand.  Th
ere's not internal kernel ABI to worry about in Linux.  RHEL might have a problem, but life is hard 
for RHEL.

The libc question is... trickier.  I think the realization of this change in glibc would turn on the
 precise language around si_status. The POSIX manual page (my copy of 'man 3p waitid' anyway) doesn'
t mention si_status at all.  The Linux manual page says:

 si_status   Either  the  exit status of the child, as given to _exit(2)
             (or exit(3)), or the signal that caused the child to termi‐
             nate,  stop, or continue.  The si_code field can be used to
             determine how to interpret this field.

On that basis I think the text in:

http://austingroupbugs.net/view.php?id=594#c1317 [^]

is plausible, since it basically says the same thing, look at si_code first.  There might be binary-
compatibility reasons to want to version the libc symbols for waitid() and sigaction() so that old a
pps get precisely the same bits they always did while new apps are expected to get it right, but tha
t's a glibc maintainer decision.


Based on that, I feel that the GNU/Linux camp (both kernel and glibc) will be able to cope with tightening the requirements in Issue 8 to mandate the current Solaris behavior of exposing all 32 bits through si_status.
(0001320)
geoffclare (manager)
2012-08-08 15:22

Based on Note: 0001318, Note: 0001317 has been edited to remove the XSI shading on the "full exit value" requirements.
(0001360)
ajosey (manager)
2012-08-30 09:20

Interpretation proposed 30 August 2012 for final 30 day review
(0001507)
ajosey (manager)
2013-03-29 08:01

Interpretation approved 29 Mar 2013

- Issue History
Date Modified Username Field Change
2012-07-17 08:00 Konrad_Schwarz New Issue
2012-07-17 08:00 Konrad_Schwarz Status New => Under Review
2012-07-17 08:00 Konrad_Schwarz Assigned To => ajosey
2012-07-17 08:00 Konrad_Schwarz Name => Konrad Schwarz
2012-07-17 08:00 Konrad_Schwarz Organization => Siemens AG
2012-07-17 08:00 Konrad_Schwarz User Reference => siginfo_t si_status
2012-07-17 08:00 Konrad_Schwarz Section => XBD headers <signal.h>
2012-07-17 08:00 Konrad_Schwarz Page Number => 334
2012-07-17 08:00 Konrad_Schwarz Line Number => 11164
2012-07-26 16:27 nick Note Added: 0001316
2012-07-26 16:27 nick Interp Status => Pending
2012-07-26 16:27 nick Final Accepted Text => See Note: 0001316
2012-07-26 16:27 nick Status Under Review => Interpretation Required
2012-07-26 16:27 nick Resolution Open => Accepted As Marked
2012-07-26 16:28 nick Tag Attached: tc2-2008
2012-07-31 08:20 geoffclare Status Interpretation Required => Under Review
2012-07-31 08:20 geoffclare Resolution Accepted As Marked => Reopened
2012-08-02 17:16 geoffclare Note Added: 0001317
2012-08-08 08:22 geoffclare Relationship added related to 0000597
2012-08-08 12:09 eblake Note Added: 0001318
2012-08-08 15:21 geoffclare Note Edited: 0001317
2012-08-08 15:22 geoffclare Note Added: 0001320
2012-08-08 15:24 geoffclare Final Accepted Text See Note: 0001316 => See Note: 0001317
2012-08-08 15:24 geoffclare Status Under Review => Interpretation Required
2012-08-08 15:24 geoffclare Resolution Reopened => Accepted As Marked
2012-08-08 15:28 msbrown Relationship replaced has duplicate 0000597
2012-08-09 10:38 geoffclare Note Edited: 0001316
2012-08-30 09:20 ajosey Interp Status Pending => Proposed
2012-08-30 09:20 ajosey Note Added: 0001360
2013-03-29 08:01 ajosey Interp Status Proposed => Approved
2013-03-29 08:01 ajosey Note Added: 0001507
2013-05-13 15:32 eblake Relationship added related to 0000690
2016-01-07 16:22 eblake Relationship added parent of 0000947
2019-06-10 08:55 agadmin Status Interpretation Required => Closed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker