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

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 1559 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 1559.


Report 1559 Actions


    Problem Report Number 1559
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Test Suite Deficiency (TSD)
    Problem Resolution ID TSD.X.0841
    Raised 2001-05-11 08:00
    Updated 2003-03-13 08:00
    Published 2001-05-18 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.1.1
    Test Identification CAPI.os/files/lockf 5
    Problem Summary TSD4U.00302 The test may fail on fast systems.
    Problem Text
    There is a timing problem with the test when run on faster
    hardware.

    Relevant section from the test code:

    static void
    test5A(void)
    {
    static pid_t pid;
    int fd;
    time_t start, now, rel;

    ...

    if ((start = time((time_t*)0)) == -1)
    {
    ...
    }
    rel = start + REL;

    FORK(pid);
    ...
    if (lockf(fd, F_LOCK, 0) == -1)
    {
    ...
    }

    if ((now = time((time_t)0)) == -1)
    {
    ...
    }
    if (now < rel)
    {
    tet_infoline("ERROR: Child didn't sleep on locked file");
    tet_result(TET_FAIL);
    exit(1);
    }
    tet_result(TET_PASS);
    EFORK;

    tet_infoline("PREP: parent: After agreed-upon time release lock");
    if ((now = time((time_t*)0)) == -1)
    {
    ...
    }
    while (now < rel)
    {
    if ((now = time((time_t*)0)) == -1)
    {
    ...
    }
    }

    if (lockf(fd, F_ULOCK, 0) == -1)
    {
    ...
    }
    ...
    }

    The problem is that the while() loop in the parent has the condition
    of now < rel, so on faster hardware, the loop could exit, lock held by
    parent released, lock obtained by child, and time() called all within
    the same second. Since time() returns the number of whole seconds
    passed, the value returned when time() is called in the child will be
    1 second less than rel, so the comparison of new to rel in the child
    will fail.

    If the while() loop is changed to have the condition of now <= rel, the
    test will pass.
    Test Output
    ************************************************************************
    /tset/CAPI.os/files/lockf/T.lockf 5 Failed

    Test Description:
    Base Required Conformance
    A successful call to int lockf(int fildes, int function, off_t size)
    when function equals F_LOCK and the section to be locked is already
    locked by another process shall block until the lock is removed.

    Test Information:
    PREP: Create a file with enforcement record locking turned on
    PREP: Lock the file
    PREP: parent: After agreed-upon time release lock
    CLEANUP: Wait for the child to terminate
    PREP: Set up an alarm to wake up process if it hangs
    TEST: Process sleeps when locking locked file
    ERROR: Child didn't sleep on locked file

    ************************************************************************

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    This is accepted as a fault in the test suite.

    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:

     

    Back   


Contact the Certification Authority