|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1435 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 1435.
Report 1435 Actions
Problem Report Number 1435 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.0717 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published 1996-01-16 08:00 Product Standard Internationalised System Calls and Libraries Extended (UNIX 95) Certification Program The Open Brand certification program Test Suite VSU version 4.0.2 Test Identification CAPIbase/writev 58 Problem Summary TSD4U.00098 This test may fail on implmentations where setpgrp() does not create a new session (VSU_SETPGRP_CREATES_SESSION is false). Problem Text
This test may fail on implmentations where setpgrp() does not create
a new session (VSU_SETPGRP_CREATES_SESSION is false).
Consequently, the writev() function is not returning an error after
the process is orphaned. Instead, the call returns successfully.
We believe that the cause of the writev58 failure is due to a programming
error in the fwritev58.c test module. The test routine was calling setpgrp()
which was failing. This failure was not spotted because it was not enclosed in
the usual error trapping wrapper. setpgrp() was failing with error EPERM
due to the caller already being a process group leader. This usual practice
to avoid this error is to first fork and then have the child call setpgrp()
so that it's process id is different to it's inherited process group id. Once
this fork was placed into the test routine it worked as expected and the
test passed.
Further, the function setpgrp() was added to XPG4 because it was defined in
the SVID. The SVID states what setpgrp() will return upon success, but is
silent about what it returns upon failure. The SVID got translated into
the XPG4 as:
DESCRIPTION
If the calling process is not already a session
leader, setpgrp() sets the process group ID of the
calling process to the process ID of the calling
process. If setpgrp() creates a new session, then
the new session has no controlling terminal.
The setpgrp() function has no effect when the
calling process is a session leader.
RETURN VALUE
Upon successful completion, setpgrp() returns the
new process group ID.
ERRORS
No errors are defined.
The test did not check for an error because no error is defined. However,
the XPG4 states "If the calling process is not already a session leader ...",
and "Upon successful completion...". What, pray tell, does it do if the
process is already a session leader? What if the completion is not successful?
So, what is missing from the equation? Well, if one reads the SVID
(rather than the XPG4), one will notice that there is a statement:
The function setpgrp() will be phased out in favor of the function
setsid() and has moved to Level 2 effective September 30, 1989.
-------
"Level 2" means it is obsolete.
So looking a the XPG4 definition of setsid():
DESCRIPTION
The setsid() function creates a new session, if the
calling process is not a process group leader. Upon
return the calling process will be the session
leader of this new session, will be the process
group leader of a new process group, and will have
no controlling terminal. The process group ID of
the calling process will be set equal to the process
ID of the calling process. The calling process will
be the only process in the new process group and the
only process in the new session.
RETURN VALUE
Upon successful completion, setsid() returns the
value of the process group ID of the calling
process. Otherwise it returns (pid_t)-1 and sets
errno to indicate the error.
ERRORS
The setsid() function will fail if:
[EPERM] The calling process is already a
process group leader, or the process
group ID of a process other than the
calling process matches the process
ID of the calling process.
The function setsid() has been in the X/Open Portability Guide since
XPG3, and *it* was added to align with POSIX! The test should not be
using setpgrp(), because it has an implied error condition but no error
return defined!! It should be using setsid() and checking the error
return!!!
Test Output
TEST PURPOSE #58
EIO in errno and return -1 on a call to ssize_t
writev(int fildes, const struct iovec *iov, int
iovcnt) when the process is a member of a background
process group and is attempting to write to its
controlling terminal, TOSTOP is set, the process is
neither ignoring nor blocking the SIGTTOU signal, and
the process is orphaned.
PREP: Allocate and initialize I/O buffers
PREP: Open master side of pseudo terminal
PREP: Open slave side as controlling terminal
PREP: Set TOSTOP
PREP: fork() a child
PREP: fork() a child of the child
PREP: Put process in background
PREP: Wait to become orphan
PREP: Catch SIGTTOU
TEST: Call writev()
TEST: writev() returns -1 with EIO set
ERROR: writev() returned 8192 with errno = 0(0 - No error), expected -1
with
errno = EIO
PREP: Let first child die so second is orphan
58 FAIL
Review Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
We agree this is a test suite deficiency in the test
suite version(s) listed.
Although this fails for the same reason as TSD4U.00027, the failure
point is different. The default openctl() function provided in the
user-defined capi_user directory does not detect the failure of the
setpgrp() function as in TSD4U.00027, where the openctl() function
contained an additional ioctl() call that fails.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Test Suite Deficiency (TSD) Review Conclusion
This is an agreed Test Suite Deficiency.
Problem Reporting System Options:
- View Report 1435
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority