|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 2385 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 2385.
Report 2385 Actions
Problem Report Number 2385 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.1232 Raised 2004-05-28 04:40 Updated 2004-06-05 03:23 Published 2004-06-05 03:23 Product Standard Internationalised System Calls and Libraries Extended V3 (UNIX 03) Certification Program The Open Brand certification program Test Suite VSU version 5.2.5 Test Identification CAPI.os/procprim/_exit 3
CAPI.os/genuts/exit 3Specification Base Definitions Issue 6 Problem Summary exit 3 and _exit 3 call fclose() on a stream opened with popen() which
causes later stream reads to fail.Problem Text The basic logic is to fork a child, have it call _exit while the parent
sleeps 10 seconds. The parent then looks for the process by calling
/bin/ps -p using popen, uses the returned stream to check the ps output
line by line searching for the pid to determine the zombie exists.
The first read of the output from ps works fine and the first subtest
passes. The next time though the logic for the next wait, for unix03
it is waitpid(), the read of the ps output fails and the test assumes
the zombie does not exist and the test fails.
The code that does the reading for all subtests:
tet_infoline("PREP: Execute /bin/ps to get child's
status");
sprintf(ebuf, "/bin/ps -p %d", (int)pid);
if((psfile = popen(ebuf, "r")) == (FILE *)NULL) {
uwerrno("popen");
return;
}
tet_infoline("TEST: Child is a zombie");
/*
** Kill will not find this process but ps can...
** We loop until the process id is found. If it is not
found
** then the process has been terminiated instead of
being turned ** into a zombie...
*/
found = 0;
sprintf(pid_str, "%d", (int)pid);
while(fgets(psline, sizeof(psline), psfile) != NULL) {
if(strstr(psline, pid_str) != NULL) {
found = 1;
break;
}
}
fclose(psfile);
Notice the call fclose() on the stream. When these are replaced with
calls to pclose(), all subtests pass. Although the standard does not
require the useof pclose(), the SUSv3 rational implies that a pclose()
should be used here.
Since the area of functionality under test here is not the behavior of
streams and fclose(), pclose() should be used here to prevent failures
that are not related to the area under test.Test Output
***********************************************************************
*
/tset/CAPI.os/procprim/_exit/T._exit 3 Failed
Test Description:
Base Required Conformance
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.
Note: wait3() is only tested in UNIX98 mode.
Test Information:
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
ERROR: Process does not exist
PREP: Set child exiting event and call exit
***********************************************************************
*
***********************************************************************
*
/tset/CAPI.os/genuts/exit/T.exit 3 Failed
Test Description:
Base Required Conformance
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.
Note: wait3() is only tested in UNIX98 mode.
Test Information:
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
ERROR: Process does not exist
PREP: Set child exiting event and call exit
***********************************************************************
*Review Information
Review Type TSMA Review Start Date 2004-05-28 04:40 Last Updated 2004-05-28 17:51 Completed 2004-05-28 17:51 Status Complete Review Recommendation Test Suite Deficiency (TSD) Review Response This is accepted as a fault in the test suite.
Review Type SA Review Start Date 2004-05-28 16:51 Last Updated 2004-06-02 00:28 Completed 2004-06-02 00:28 Status Complete Review Resolution Test Suite Deficiency (TSD) Review Conclusion This PR represents an agreed test suite deficiency.
Problem Reporting System Options:
- View Report 2385
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority