|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1900 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 1900.
Report 1900 Actions
Problem Report Number 1900 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.0961 Raised 2002-12-17 08:00 Updated 2003-03-13 08:00 Published 2002-12-17 08:00 Product Standard Internationalised System Calls and Libraries Extended V2 (UNIX 98) Certification Program The Open Brand certification program Test Suite VSX4 version 4.5.3 Test Identification POSIX.os/ioprim/fcntl 11,12,15,16,23 Problem Summary TSD5.030 The test suite as coded expects that adjacent locks set by fcntl() are coalesced. One system does not coalesce locks. According to PASC Interpretation reference 1003.1-90 #50, either behavior conforms... Problem Text
The test suite as coded expects that adjacent locks set by
fcntl() are coalesced. One system does not coalesce locks.
According to PASC Interpretation reference 1003.1-90 #50, either
behavior conforms to POSIX.1. XPG4 adds no extended specifications
on this point.
This behavior has previously been approved for XPG3 in, for example,
interpetation PG3.727
_____________________________________________________________________________
PASC Interpretation reference
1003.1-90 #50
Classification: No change
This response will be incorporated in an IEEE interpretations
publication, and will be also made available on-line on the IEEE
SPAsystem.
_____________________________________________________________________________
Interpretation Number: (to be assigned by the IEEE)
Topic: fcntl() locking
Relevant Sections: 6.5.2.2
Interpretation Request:
-----------------------
+Interpretation Request ref : VWG/008/063092
[Problem description]
fcntl() locking
During the development of a test suite for ISO POSIX.1 the
following question was raised with regard to the fcntl()
function and coalescence of adjacent locks.
[Request text starts] POSIX.1-1990 Section 6.5.2.2 fcntl() :
Should adjacent locks be coalesced when F_GETLK is used to
check for existence of locks?
X/Open would propose that they should not be so:
In fcntl(), page 107 line 161ff of the System Interfaces and
headers document it says:
"There will be at most one type of lock for each byte in
the file. Before successfull return from an F_SETLK or
an F_SETLKW request when the calling process has
previously existing locks on bytes in the region
specified by the request, the previous lock type for
each byte in the specified region will be replaced by
the new lock type."
Meaning that if two locks for overlapping regions of a file
are obtained by a single process, the region which overlaps
will be owned by the new lock. Coalescing is not required.
[text ends]
(Josey-X/Open)
IEEE Interpretation for 1003.1-1990 (9945-1:1990):
--------------------------------------------------
IEEE Std 1003.1-1990 does not specify whether there may be
distinct overlapping locks for the same process or multiple
locks of the same type on the same byte for the same process.
It is unspecified, when multiple F_SETLK or F_SETLKW requests
for the same lock type have been made by the same process that
address a common extent in the file, whether multiple requests
with F_UNLCK are necessary in order to unlock that common
extent.
Coalescing of locks is neither required nor prohibited. It
would be conforming for an implementation to treat adjacent or
overlapping locks of the same type for the same process as if
they were coalesced immediately on creation.
Rationale for Interpretation:
-----------------------------
The request exhibits some confusion between the concepts "one
type of lock set for each byte" and "one lock set for each
byte". POSIX.1 does not prohibit having more than one lock of
the same type on the same byte of a file for the same process.
The standard does not provide a handle by which an individual
lock may be identified after it is set. This means that a
process can identify a lock only by the values in the struct
flock returned by an F_GETLK request. The standard does not
require that the values returned by an F_GETLK request
correspond exactly to an extent that was locked by a single
F_SETLK or F_SETLKW request. The specification quoted in the
request (that each byte in the file be affected by only one type
of lock) can further obscure the identity of individual locks,
since the creation of a new lock of a different type could cause
an old lock to be truncated or to be divided into discontinuous
extents. See B.6.5.2, page 271, lines 3661-3666.
It is unspecified whether a process can use F_GETLK to identify
its own locks. A strictly conforming application must cause the
F_GETLK request to be made from a different process.
_____________________________________________________________________________
(c) 1994 The Institute of Electrical and Electronic Engineers, Inc.
Not to be published without prior written permission of the IEEE.
This problem is reported in the VSX Release notes and only affects a
single system. This problem would require considerable changes in the
user test set-up in order for a correction to be effective.Test Output
************************************************************************
/tset/POSIX.os/ioprim/fcntl/T.fcntl 11 Failed
Test Description:
For the XNFS specification:
If the implementation supports file locking for files residing on
a remote file system: On a call to fcntl(fildes, F_SETLK, arg)
when l_type = F_RDLCK is specified a shared lock is created on the
segment specified in arg.
For the XSH specification:
On a call to fcntl(fildes, F_SETLK, arg) when l_type = F_RDLCK is
specified a shared lock is created on the segment specified in
arg.
Posix Ref: Component FCNTL Assertion 6.5.2.2-16(A)
Test Strategy:
OPEN pipes using opensync() - (genlib)
OPEN new file using creat()
WRITE 40 bytes to file
CLOSE file and OPEN it again O_RDWR
SEEK to offset 5 within the file
CREATE process pair
PARENT Process:
SET lock {F_RDLCK, SEEK_SET, 5, 5, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
5, 20, 0} gives lock description {F_RDLCK, SEEK_SET, 5, 5,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_RDLCK, SEEK_SET, 10, 5, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
5, 20, 0} gives lock description {F_RDLCK, SEEK_SET, 5, 10,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_RDLCK, SEEK_SET, 10, 10, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
5, 20, 0} gives lock description {F_RDLCK, SEEK_SET, 5, 15,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_RDLCK, SEEK_SET, 5, 20, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
5, 25, 0} gives lock description {F_RDLCK, SEEK_SET, 5, 20,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_WRLCK, SEEK_SET, 20, 10, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
5, 25, 0} gives lock description {F_RDLCK, SEEK_SET, 5, 15,
getppid()}
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
20, 25, 0} gives lock description {F_WRLCK, SEEK_SET, 20, 10,
getppid()}
Test Information:
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 10
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 15
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 20
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 15
************************************************************************
************************************************************************
/tset/POSIX.os/ioprim/fcntl/T.fcntl 12 Failed
Test Description:
For the XNFS specification:
If the implementation supports file locking for files residing on
a remote file system: On a call to fcntl(fildes, F_SETLK, arg)
when l_type = F_WRLCK is specified an exclusive lock is created on
the segment specified in arg.
For the XSH specification:
On a call to fcntl(fildes, F_SETLK, arg) when l_type = F_WRLCK is
specified an exclusive lock is created on the segment specified in
arg.
Posix Ref: Component FCNTL Assertion 6.5.2.2-17(A)
Test Strategy:
OPEN pipes using opensync() - (genlib)
OPEN new file using creat()
WRITE 40 bytes to file
CLOSE file and OPEN it again O_RDWR
SEEK to offset 5 within the file
CREATE process pair
PARENT Process:
SET lock {F_WRLCK, SEEK_SET, 5, 5, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
5, 20, 0} gives lock description {F_WRLCK, SEEK_SET, 5, 5,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_WRLCK, SEEK_SET, 10, 5, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
5, 20, 0} gives lock description {F_WRLCK, SEEK_SET, 5, 10,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_WRLCK, SEEK_SET, 10, 10, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
5, 20, 0} gives lock description {F_WRLCK, SEEK_SET, 5, 15,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_WRLCK, SEEK_SET, 5, 20, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
5, 25, 0} gives lock description {F_WRLCK, SEEK_SET, 5, 20,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_RDLCK, SEEK_SET, 20, 10, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
5, 25, 0} gives lock description {F_WRLCK, SEEK_SET, 5, 15,
getppid()}
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
20, 25, 0} gives lock description {F_RDLCK, SEEK_SET, 20, 10,
getppid()}
Test Information:
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 10
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 15
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 20
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 15
************************************************************************
************************************************************************
/tset/POSIX.os/ioprim/fcntl/T.fcntl 15 Failed
Test Description:
For the XNFS specification:
If the implementation supports file locking for files residing on
a remote file system: On a call to fcntl(fildes, F_SETLKW, arg)
when l_type = F_RDLCK is specified a shared lock is created on the
segment specified in arg.
For the XSH specification:
On a call to fcntl(fildes, F_SETLKW, arg) when l_type = F_RDLCK is
specified a shared lock is created on the segment specified in
arg.
Posix Ref: Component FCNTL Assertion 6.5.2.2-20(A)
Test Strategy:
OPEN pipes using opensync() - (genlib)
OPEN new file using creat()
WRITE 40 bytes to file
CLOSE file and OPEN it again O_RDWR
SEEK to offset 5 within the file
CREATE process pair
PARENT Process:
SET lock {F_RDLCK, SEEK_SET, 5, 5, 0} using fcntl(F_SETLKW)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
5, 20, 0} gives lock description {F_RDLCK, SEEK_SET, 5, 5,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_RDLCK, SEEK_SET, 10, 5, 0} using fcntl(F_SETLKW)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
5, 20, 0} gives lock description {F_RDLCK, SEEK_SET, 5, 10,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_RDLCK, SEEK_SET, 10, 10, 0} using fcntl(F_SETLKW)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
5, 20, 0} gives lock description {F_RDLCK, SEEK_SET, 5, 15,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_RDLCK, SEEK_SET, 5, 20, 0} using fcntl(F_SETLKW)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
5, 25, 0} gives lock description {F_RDLCK, SEEK_SET, 5, 20,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_WRLCK, SEEK_SET, 20, 10, 0} using fcntl(F_SETLKW)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
5, 25, 0} gives lock description {F_RDLCK, SEEK_SET, 5, 15,
getppid()}
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
20, 25, 0} gives lock description {F_WRLCK, SEEK_SET, 20, 10,
getppid()}
Test Information:
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 10
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 15
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 20
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 15
************************************************************************
************************************************************************
/tset/POSIX.os/ioprim/fcntl/T.fcntl 16 Failed
Test Description:
For the XNFS specification:
If the implementation supports file locking for files residing on
a remote file system: On a call to fcntl(fildes, F_SETLKW, arg)
when l_type = F_WRLCK is specified an exclusive lock is created on
the segment specified in arg.
For the XSH specification:
On a call to fcntl(fildes, F_SETLKW, arg) when l_type = F_WRLCK is
specified an exclusive lock is created on the segment specified in
arg.
Posix Ref: Component FCNTL Assertion 6.5.2.2-21(A)
Test Strategy:
OPEN pipes using opensync() - (genlib)
OPEN new file using creat()
WRITE 40 bytes to file
CLOSE file and OPEN it again O_RDWR
SEEK to offset 5 within the file
CREATE process pair
PARENT Process:
SET lock {F_WRLCK, SEEK_SET, 5, 5, 0} using fcntl(F_SETLKW)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
5, 20, 0} gives lock description {F_WRLCK, SEEK_SET, 5, 5,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_WRLCK, SEEK_SET, 10, 5, 0} using fcntl(F_SETLKW)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
5, 20, 0} gives lock description {F_WRLCK, SEEK_SET, 5, 10,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_WRLCK, SEEK_SET, 10, 10, 0} using fcntl(F_SETLKW)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
5, 20, 0} gives lock description {F_WRLCK, SEEK_SET, 5, 15,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_WRLCK, SEEK_SET, 5, 20, 0} using fcntl(F_SETLKW)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
5, 25, 0} gives lock description {F_WRLCK, SEEK_SET, 5, 20,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_RDLCK, SEEK_SET, 20, 10, 0} using fcntl(F_SETLKW)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
5, 25, 0} gives lock description {F_WRLCK, SEEK_SET, 5, 15,
getppid()}
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
20, 25, 0} gives lock description {F_RDLCK, SEEK_SET, 20, 10,
getppid()}
Test Information:
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 10
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 15
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 20
F_RDLCK not created/detected properly
lock lengths differ: got 5 - expected 15
************************************************************************
************************************************************************
/tset/POSIX.os/ioprim/fcntl/T.fcntl 23 Failed
Test Description:
For the XNFS specification:
If the implementation supports file locking for files residing on
a remote file system: For any lock type the segment specification
can be set to extend to end of file by setting l_len to zero.
For the XSH specification:
For any lock type the segment specification can be set to extend
to end of file by setting l_len to zero.
Posix Ref: Component FCNTL Assertion 6.5.2.2-29(A)
Test Strategy:
OPEN pipes using opensync() - (genlib)
OPEN new file using creat()
WRITE 40 bytes to file
CLOSE file and OPEN it again O_RDWR
SEEK to offset 5 within the file
CREATE process pair
PARENT Process:
SET lock {F_WRLCK, SEEK_SET, 10, 0, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
20, 5, 0} gives lock description {F_WRLCK, SEEK_SET, 10, 0,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_WRLCK, SEEK_SET, 0, 0, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_RDLCK, SEEK_SET,
20, 5, 0} gives lock description {F_WRLCK, SEEK_SET, 0, 0,
getppid()}
CREATE process pair
PARENT Process:
SET lock {F_RDLCK, SEEK_SET, 10, 0, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
20, 5, 0} gives lock description {F_RDLCK, SEEK_SET, 10, 0,
getppid()}
WRITE data to pipe using sendsync() - (genlib)
PARENT Process:
READ data from pipe using waitsync() - (genlib)
SET lock {F_RDLCK, SEEK_SET, 0, 0, 0} using fcntl(F_SETLK)
WRITE data to pipe using sendsync() - (genlib)
CHILD Process:
READ data from pipe using waitsync() - (genlib)
VERIFY that fcntl(F_GETLK) with lock description {F_WRLCK, SEEK_SET,
20, 5, 0} gives lock description {F_RDLCK, SEEK_SET, 0, 0,
getppid()}
Test Information:
the whole file was not locked when l_len = l_start = 0
lock start points differ: got 10 - expected 0
************************************************************************Review Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
This is an agreed Test Suite Deficiency.
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 1900
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority