HomeAbout Us A-Z IndexSearch * Contact Us Register LoginPress Shop

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 1267 Details

Help Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges

This page provides all information on Problem Report 1267.


Report 1267 Actions


    Problem Report Number 1267
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Test Suite Deficiency (TSD)
    Problem Resolution ID TSD.X.0549
    Raised 1970-01-01 08:00
    Updated 2003-03-13 08:00
    Published 1999-03-03 08:00
    Product Standard Internationalised System Calls and Libraries Extended V2 (UNIX 98)
    Certification Program The Open Brand certification program
    Test Suite VSU version 5.0.3
    Test Identification CAPIbase/lockf 43
    Problem Summary TSD4U.00269 This test may fail as it does not pass the correct limits to setrlimit.
    Problem Text
    In PG4U.00160, the consultants stated the following:

    "We believe this test is correct as written. Before calling lseek() the
    test sets RLIMIT_FSIZE beyond where it seeks to and hence is not
    seeking beyond the maximum file size."

    The code in t43smloff.c looks like this.

    if (getrlimit(RLIMIT_FSIZE, &save) != 0) {

    limitsModified = 0;
    if ((save.rlim_max == RLIM_INFINITY) &&
    (save.rlim_cur != RLIM_INFINITY)) {
    setrlp.rlim_cur = (rlim_t)MAXOFF_VAL(sizeof(off_t))+OFF_TRLIMIT;
    setrlp.rlim_max = save.rlim_max;
    limitsModified = 1;
    } else {
    if (!((save.rlim_max == RLIM_INFINITY) &&
    (save.rlim_cur == RLIM_INFINITY))) {
    setrlp.rlim_cur = (rlim_t)MAXOFF_VAL(sizeof(off_t))+OFF_TRLIMIT;
    setrlp.rlim_max = (rlim_t)MAXOFF_VAL(sizeof(off_t))+OFF_TRLIMIT;
    limitsModified = 1;
    }
    }
    if (limitsModified) {
    errno = 0;
    if (setrlimit(RLIMIT_FSIZE, &save) != 0) {

    There are three problems with this code;

    1) It appears that it was intended to use setrlp to change the rlimits.
    However. the setrlimit() call doesn't change anything as it uses the initial
    values from the getrlimit() call.

    2) If save.rlim_max and save.rlim_cur are both equal to RLIM_INFINITY, then
    setrlp is not set and setrlimit() is not called.

    3) The consultant response indicates that the RLIMIT_FSIZE is being set beyond
    the offset used in the lseek() call. If (1) and (2) are fixed, then the
    calculation (rlim_t)MAXOFF_VAL(sizeof(off_t))+OFF_TRLIMIT will set the
    RLIMIT_FSIZE to a limit above our implementation maximum file size.
    Test Output

    ------- output from system running in 32 BIT mode -----------------

    TEST CASE: lockf

    TEST PURPOSE #43
    EOVERFLOW in errno and return -1 on a call to int
    lockf(int fildes, int function, off_t size) when size
    is not 0 and the offset of the last byte in the
    requested section cannot be represented correctly in
    an object of type off_t.
    PREP: Check for existence of programming environments
    PREP: Obtain off_t size in XBS5_ILP32_OFF32 environment
    PREP: Obtain off_t size in XBS5_ILP32_OFFBIG environment
    INFO: Execution environment for XBS5_LP64_OFF64 not supported
    INFO: Execution environment for XBS5_LPBIG_OFFBIG not supported
    TEST: Execute test built in XBS5_ILP32_OFF32 (32-bit off_t) environment that:
    opens a file for writing,
    set the offset below that which can be represented in an off_t
    verifies lockf returns -1 and sets errno to EOVERFLOW when offset
    of the last byte in request cannot be represented in an off_t object
    TEST: Execute test built in XBS5_ILP32_OFFBIG (64-bit off_t) environment that:
    opens a file for writing,
    set the offset below that which can be represented in an off_t
    verifies lockf returns -1 and sets errno to EOVERFLOW when offset
    of the last byte in request cannot be represented in an off_t object
    ERROR: In test program: lseek() failed, errno = 22(Invalid argument)


    ------- output from system running in 64 BIT mode -----------------

    TEST CASE: lockf

    TEST PURPOSE #43
    EOVERFLOW in errno and return -1 on a call to int
    lockf(int fildes, int function, off_t size) when size
    is not 0 and the offset of the last byte in the
    requested section cannot be represented correctly in
    an object of type off_t.
    PREP: Check for existence of programming environments
    PREP: Obtain off_t size in XBS5_ILP32_OFF32 environment
    PREP: Obtain off_t size in XBS5_ILP32_OFFBIG environment
    PREP: Obtain off_t size in XBS5_LP64_OFF64 environment
    PREP: Obtain off_t size in XBS5_LPBIG_OFFBIG environment
    TEST: Execute test built in XBS5_ILP32_OFF32 (32-bit off_t) environment that:
    opens a file for writing,
    set the offset below that which can be represented in an off_t
    verifies lockf returns -1 and sets errno to EOVERFLOW when offset
    of the last byte in request cannot be represented in an off_t object
    TEST: Execute test built in XBS5_ILP32_OFFBIG (64-bit off_t) environment that:
    opens a file for writing,
    set the offset below that which can be represented in an off_t
    verifies lockf returns -1 and sets errno to EOVERFLOW when offset
    of the last byte in request cannot be represented in an off_t object
    ERROR: In test program: lseek() failed, errno = 22(Invalid argument)
    TEST: Execute test built in XBS5_LP64_OFF64 (64-bit off_t) environment that:
    opens a file for writing,
    set the offset below that which can be represented in an off_t
    verifies lockf returns -1 and sets errno to EOVERFLOW when offset
    of the last byte in request cannot be represented in an off_t object
    ERROR: In test program: lseek() failed, errno = 22(Invalid argument)
    TEST: Execute test built in XBS5_LPBIG_OFFBIG (64-bit off_t) environment that:
    opens a file for writing,
    set the offset below that which can be represented in an off_t
    verifies lockf returns -1 and sets errno to EOVERFLOW when offset
    of the last byte in request cannot be represented in an off_t object
    ERROR: In test program: lseek() failed, errno = 22(Invalid argument)
    43 UNRESOLVED

    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.

    Please note this is based on submitter's issue 1 only. We do not agree
    with the other issues raised:

    > 2) If save.rlim_max and save.rlim_cur are both equal to RLIM_INFINITY, then
    > setrlp is not set and setrlimit() is not called.

    We believe this is correct - if both limits are RLIM_INFINITY no limit is
    enforced so there is no need to change the limit settings.

    > 3) The consultant response indicates that the RLIMIT_FSIZE is being set
    > beyond the offset used in the lseek() call. If (1) and (2) are fixed,
    > then the calculation (rlim_t)MAXOFF_VAL(sizeof(off_t))+OFF_TRLIMIT will
    > set the RLIMIT_FSIZE to a limit above our implementation maximum file size.

    Please refer to section 4.1.3 of the VSU User's Guide which defines the
    testing requirements in this regard:

    For UNIX 98 testing, VSU generates files with sizes as large as 2.5GB in
    the course of testing. The file size limit on the implementation must
    be set to accommodate these files sizes, unless Large File testing cannot
    be performed on the implementation (see section 5.1.6 on page 35).

    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. This applies to issue
    1. above only.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority