|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1198 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 1198.
Report 1198 Actions
Problem Report Number 1198 Submitter's Classification Specification problem State Resolved Resolution Rejected (REJ) Problem Resolution ID REJ.X.0400 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published null Product Standard Internationalised System Calls and Libraries Extended (UNIX 95) Certification Program The Open Brand certification program Test Suite VSU version 4.1.0 Test Identification CAPIbase/exit 1 2 3 Problem Summary PG4U.00067 This IR claims that the si_status member of the infop should be interpreted using the WEXITSTATUS() macro described in wait(). Problem Text
This IR claims that the si_status member of infop should be
interpreted using the WEXITSTATUS() macro described in wait().
The specification states in the waitid() description:
"The infop argument must point to a siginfo_t structure. If waitid()
returns because a child process was found that satisfied the
conditions indicated by the arguments idtype and options, then the
structure pointed to by infop will be filled in by the system with
the status of the process. The si_signo member will always be
equal to SIGCHLD."
The specification requires that infop be "filled in by the system
with the status of the process", it does NOT however state how one
must access the contents of the infop structure to obtain the status
of the the process. Our implementation does indeed place the
status of the process into infop, however it is not in the lower 8
bytes of the si_status member, and we contend it is not required
to be in the lower 8 bits by the specification.
The macro WEXITSTATUS() does correctly produce the lower 8-bits
of the status of the process from the si_status member, on our
implementation.
That is, if the assertion for waitid() were coded:
if(WEXITSTATUS(info.si_status) != 0xEF) {
rather than
if((info.si_status & 0xff) != 0xEF) {
we would pass the assertion.
We realize the the specification also does not specifically discuss
the WIFEXITED() or WEXITSTATUS() macros for waitid() as it does for
wait() and waitpid(), nor does it say "see waitpid()" for the return
value as it does for wait3(). However, since it also does not
specifically state that the lower 8 bits of the status be contained
in the lower 8 bits of the si_status member of the infop structure,
we feel that this is a gray area in the specification and a
permanent interpretation should be granted.Test Output
SPEC1170TESTSUITE CASE 1
When the parent process of the calling process is
executing wait(), waitpid(), wait3() or waitid() and
has neither set its SA_NOCLDWAIT flag nor set SIGCHLD
to SIG_IGN a call to void _exit(int
status) shall notify it of the termination of the
calling process and make the low-order eight bits of
status available to it.
PREP: Set SIGCHLD to SIG_DFL and clear SA_NOCLDWAIT
PREP: Fork child
TEST: wait notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Call _exit
TEST: wait3 notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Call _exit
TEST: Subsequent waitpid notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Call _exit
TEST: waitid notified of termination
TEST: Lower 8-bits of status available
ERROR: Returned status 0x0, expected 0xef
PREP: Call _exit
FAIL
IC End
SPEC1170TESTSUITE CASE 2
When the parent process of the calling process is not
executing wait(), waitpid(), wait3() or waitid() a
call to void _exit(int status) shall
cause the lower 8 bits of status to be made available
to it upon a subsequent call to wait(), waitpid() or
waitid().
PREP: Set SIGCHLD to SIG_DFL and clear SA_NOCLDWAIT
PREP: Fork child
PREP: Wait for child to exit plus a small amount of time
TEST: Subsequent wait notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Set child exiting event and call exit
PREP: Wait for child to exit plus a small amount of time
TEST: Subsequent wait3 notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Set child exiting event and call exit
PREP: Wait for child to exit plus a small amount of time
TEST: Subsequent waitpid notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Set child exiting event and call exit
PREP: Wait for child to exit plus a small amount of time
TEST: Subsequent waitid notified of termination
TEST: Lower 8-bits of status available
ERROR: Returned status 0x0, expected 0xef
PREP: Set child exiting event and call exit
FAIL
IC End
SPEC1170TESTSUITE CASE 3
When the parent process of the calling process is not
executing wait(), waitpid(), wait3() or waitid() and
has not set its SA_NOCLDWAIT flag nor set SIGCHLD to
SIG_IGN a call to void _exit(int status)
shall transform the calling process into a zombie
process such that it shall be inactive but not deleted
until subsequent execution of wait(), waitpid(),
wait3() or waitid() by its parent process.
PREP: Set SIGCHLD to SIG_DFL and clear SA_NOCLDWAIT
PREP: Fork child
PREP: Wait for child to exit plus a small amount of time
PREP: Execute /bin/ps to get child's status
TEST: Child is a zombie
TEST: Subsequent wait notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Set child exiting event and call exit
PREP: Wait for child to exit plus a small amount of time
PREP: Execute /bin/ps to get child's status
TEST: Child is a zombie
TEST: Subsequent wait3 notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Set child exiting event and call exit
PREP: Wait for child to exit plus a small amount of time
PREP: Execute /bin/ps to get child's status
TEST: Child is a zombie
TEST: Subsequent waitpid notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Set child exiting event and call exit
PREP: Wait for child to exit plus a small amount of time
PREP: Execute /bin/ps to get child's status
TEST: Child is a zombie
TEST: Subsequent waitid notified of termination
TEST: Lower 8-bits of status available
ERROR: Returned status 0x0, expected 0xef
PREP: Set child exiting event and call exit
FAIL
IC End
SPEC1170TESTSUITE CASE 1
When the parent process of the calling process is
executing wait(), waitpid(), wait3() or waitid() and
has not set its SA_NOCLDWAIT flag nor set SIGCHLD to
SIG_IGN a call to void exit(int status) shall notify
it of the termination of the calling process and make
the low-order eight bits of status available to it.
PREP: Set SIGCHLD to SIG_DFL and clear SA_NOCLDWAIT
PREP: Fork child
TEST: wait notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Call exit
TEST: wait3 notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Call exit
TEST: Subsequent waitpid notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Call exit
TEST: waitid notified of termination
TEST: Lower 8-bits of status available
ERROR: Returned status 0x0, expected 0xef
PREP: Call exit
FAIL
IC End
SPEC1170TESTSUITE CASE 2
When the parent process of the calling process is not
executing wait(), waitpid(), wait3() or waitid() and
has not set its SA_NOCLDWAIT flag nor set SIGCHLD to
SIG_IGN a call to void exit(int status) shall cause
the lower 8 bits of status to be made available to it
upon a subsequent call to wait(), waitpid(), wait3()
or waitid().
PREP: Set SIGCHLD to SIG_DFL and clear SA_NOCLDWAIT
PREP: Fork child
PREP: Wait for child to exit plus a small amount of time
TEST: Subsequent wait notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Set child exiting event and call exit
PREP: Wait for child to exit plus a small amount of time
TEST: Subsequent wait3 notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Set child exiting event and call exit
PREP: Wait for child to exit plus a small amount of time
TEST: Subsequent waitpid notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Set child exiting event and call exit
PREP: Wait for child to exit plus a small amount of time
TEST: Subsequent waitid notified of termination
TEST: Lower 8-bits of status available
ERROR: Returned status 0x0, expected 0xef
PREP: Set child exiting event and call exit
FAIL
IC End
SPEC1170TESTSUITE CASE 3
When the parent process of the calling process is not
executing wait(), waitpid(), wait3() or waitid() and
has not set its SA_NOCLDWAIT flag nor set SIGCHLD to
SIG_IGN a call to void exit(int status)
shall transform the calling process into a zombie
process such that it shall be inactive but not deleted
until subsequent execution of wait(), waitpid(),
wait3() or waitid() by its parent process.
PREP: Set SIGCHLD to SIG_DFL and clear SA_NOCLDWAIT
PREP: Fork child
PREP: Wait for child to exit plus a small amount of time
PREP: Execute /bin/ps to get child's status
TEST: Child is a zombie
TEST: Subsequent wait notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Set child exiting event and call exit
PREP: Wait for child to exit plus a small amount of time
PREP: Execute /bin/ps to get child's status
TEST: Child is a zombie
TEST: Subsequent wait3 notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Set child exiting event and call exit
PREP: Wait for child to exit plus a small amount of time
PREP: Execute /bin/ps to get child's status
TEST: Child is a zombie
TEST: Subsequent waitpid notified of termination
TEST: Lower 8-bits of status available
PREP: Fork child
PREP: Set child exiting event and call exit
PREP: Wait for child to exit plus a small amount of time
PREP: Execute /bin/ps to get child's status
TEST: Child is a zombie
TEST: Subsequent waitid notified of termination
TEST: Lower 8-bits of status available
ERROR: Returned status 0x0, expected 0xef
PREP: Set child exiting event and call exit
FAIL
IC EndReview Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
We recommend this request be refused.
We believe the test is correct.
The si_status field of the siginfo_t type infop structure is described
in <signal.h>, page 797 as follows:
int si_status exit value or signal
The exit() spec defines the exit value as the low order 8 bits
of the status argument. This is what must be placed in the si_status
member.
The question is how applications access the si_status information.
There is no mention of WEXITSTATUS in the waitid() spec, so there
is no reason to assume its use is required (or even allowable).
WEXITSTATUS is a part of the wait() spec. It is defined to
decode the stat_val returned by wait*() calls. This is necessary
because stat_val includes more information than just the exit
status. A collection of W* macros (such as WEXITSTATUS) are
defined to separate the various pieces of information contained in
stat_val.
This is not the case for waitid(). The siginfo_t type infop structure
splits the stat_val information into different structure members as
shown below
wait() macro siginfo_t type infop information
WIFEXITED - si_code is CLD_EXITED
WEXITSTATUS - si_status when si_code is CLD_EXITED
WIFSIGNALED - si_code is CLD_KILLED or CLD_DUMPED
WTERMSIG - si_status when si_code is CLD_KILLED or CLD_DUMPED
WIFSTOPPED - si_code is CLD_STOPPED
WSTOPSIG - si_status when si_code is CLD_STOPPED
WIFCONTINUED - si_code is CLD_CONTINUED
Since there are different members for each piece of information
there is no need for macros to access each separate piece.
si_status should be accessed directly and must contain the exit
status in its low order 8 bits.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Rejected (REJ) Review Conclusion
This request is refused.
Problem Reporting System Options:
- View Report 1198
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority