Report 0266 Actions
Problem Report Number |
0266 |
Submitter's Classification |
Test Suite problem |
State |
Resolved |
Resolution |
Test Suite Deficiency (TSD) |
Problem Resolution ID |
TSD.X.0266 |
Raised |
1997-09-15 08:00 |
Updated |
2003-03-13 08:00 |
Published |
1997-10-09 08:00 |
Product Standard |
Internationalised System Calls and Libraries (XPG4) |
Certification Program |
The Open Brand certification program |
Test Suite |
VSX4 version 4.3.6 |
Test Identification |
POSIX.os/ioprim/fcntl 5 |
Problem Summary |
TSD4.266 Test Overview: The VSX tests are being run in a 64-bit version of our OS which supports large files. The test fails due to the detection an extra bit turned on in the return flag. Basically, the test ... |
Problem Text |
Test Overview: -------------
The VSX tests are being run in a 64-bit version of our OS which supports large files. The test fails due to the detection an extra bit turned on in the return flag.
Basically, the test (test 5) does the following:
1. opens a file with a certain set of flags, 2. calls fcntl w/F_GETFL to get the file status flags and file access modes. 3. checks the return flags against the same variable used to open the file.
Code snipit for test5() enclosed:
---------------------------------------------------------------------------- private int t4_status[T4_NFD] = { O_RDONLY | O_NONBLOCK | O_APPEND, O_RDWR | O_APPEND, O_WRONLY | O_NONBLOCK }; ---------------------------------------------------------------------------- if ((fd[i] = open_to(t5_file, O_CREAT|t4_status[i], MODEGEN, WAITTIME)) == SYSERROR) { err[i] = errno; fail++; flag[i] = 1; } else PATH_TRACE;
globok = 0; rval[i] = tb_fcntl(fd[i], F_GETFL, 0, NULLFLK, NOERROR, NOERROR) ; PATH_FUNC_TRACE;
if (rval[i] != t4_status[i]) { fail++; flag[i] = 2; }
----------------------------------------------------------------------------
Analysis: ---------
We believe that the test has a defect. Due to the following reasons:
1. The test is testing for bits outside of those defined in <fcntl.h>.
2. The extra bit detected corresponds to the O_LARGEFILE indicator defined in the Large Files Summit. This indicator is turned on in our 64-bit implementation to indicate that this file is of a large file type. It would not make sense in 64-bits to restrict file creations to less than 64-bit size.
We believe that the test should only test for those defined in the std for fcntl, F_GETFL (XSH page 148). The test should not make the assumption that other states, not defined by the XSH, can not exist.
|
Test Output |
************************************************************************ /tset/POSIX.os/ioprim/fcntl/T.fcntl 5 Unresolved
Test Description: On a call to fcntl(fildes, F_GETFL), the file access modes and status flags O_RDONLY, O_WRONLY, O_RDWR, O_NONBLOCK and O_APPEND shall be returned for the file specified by fildes. Posix Ref: Component FCNTL Assertion 6.5.2.2-08(A)
Test Information: fcntl(102328, F_GETFL, 0) did not return flags file was opened with fcntl(F_GETFL) returned 0204010, file was opened with 0200010 fcntl(-1342168969, F_GETFL, 0) did not return flags file was opened with fcntl(F_GETFL) returned 04012, file was opened with 012 fcntl(-19968, F_GETFL, 0) did not return flags file was opened with fcntl(F_GETFL) returned 0204001, file was opened with 0200001 ************************************************************************
|
Review Information
Review Type |
TSMA Review |
Start Date |
null |
Completed |
null |
Status |
Complete |
Review Recommendation |
No Resolution Given |
Review Response |
The XSH4 specification states in the description of open() that
"The file status flags and file access modes of the open file description will be set according to the value of oflag."
and for fcntl() with F_GETFL that it will
"Get the file status flags and file access modes, defined in <fcntl.h>, for the file description associated with fildes."
The question that arises from this request is whether or not a system which is operating in an XSH4 environment is allowed to set file status flags from a mechanism other than that specified by XSH4. Clearly, had the O_LARGEFILE flag been set in the open(), it would have been expected to appear in the call to fcntl(.., F_GETFL, ...). However, the case that we have here is where the flag is being silently set by the call to open(). It seems that the validity of this depends on the interpretation of the phrase "set according to the value of oflag", which may be an exclusive statement or may allow for additional settings to be made.
It is recommended that this request is forwarded to the working group for further interpretation and review. The consultants view is that the phrase in the specification of open() does not allow for the automatic setting of file status flags.
|
Review Type |
Expert Group Review |
Start Date |
null |
Completed |
null |
Status |
Complete |
Review Resolution |
No Resolution Given |
Review Conclusion |
A Test Suite Deficiency should be granted.
The test suite should be testing that the flags specified in XSH are set/cleared by open(), fcntl(), ... as required, but must not assume that the implementation doesn't set other flags not mentioned in XSH.
|
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:
|