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

The Open Brand -- Problem Reporting and Interpretations System


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


Report 1362 Actions


    Problem Report Number 1362
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Test Suite Deficiency (TSD)
    Problem Resolution ID TSD.X.0644
    Raised 1970-01-01 08:00
    Updated 2003-03-13 08:00
    Published 1997-01-06 08:00
    Product Standard Commands and Utilities V2 (UNIX 95)
    Certification Program The Open Brand certification program
    Test Suite VSU version 4.1.1
    Test Identification base/sigignore 4
    Problem Summary TSD4U.00173 This test may fail on implementations that happen to schedule the child process before the parent and skew the time calculation.
    Problem Text
    This test may fail on implementations that happen to schedule the
    child process before the parent and skew the time calculation.

    A timing problem in sigignore test #4 causes the test to fail
    intermittently on slow machines.

    In fsignore1.c, the code testing the assertion follows:

    tet_infoline("PREP: fork() a child that sleeps");
    FORK(pid);
    sleep(1);
    EFORK;

    tet_infoline("TEST: waitpid() returns -1 and errno = ECHILD");
    errno=0;
    time(&time1);
    if((result=waitpid(pid,&stat_val,0)) != -1 || errno != ECHILD) {
    sprintf(ebuf,"ERROR: waitpid() failed. Returned %d,errno = %s",
    result,err_lookup(errno));
    tet_infoline(ebuf);
    tet_result(TET_FAIL);
    return;
    }
    time(&time2);

    tet_infoline("TEST: waitpid() blocks until child exits");
    if(time2-time1<1) {
    tet_infoline("ERROR: waitpid() did not block");
    tet_result(TET_FAIL);
    return;
    }

    Sigpause 4 forks a child. The child sleeps for a second; the parent does a
    time() to record the starting time, and waitpid() on the child process. When
    waitpid returns, the parent does another time() and calculates the difference
    between the two calls to time(). If the difference is less than 1, the test
    fails.

    There is a timing problem with the way in which this test has been implemented.
    The assumption is made that the parent will run prior to the child. In the
    case where the child is scheduled first after the fork, the child begins its
    sleep prior to the first time() and the waitpid() in the parent. Consequently,
    the timing code in the parent misses part or all of the one second sleep, which
    causes the time()-waitpid()-time() to return before a second elapses. On our
    systems, this does not happen very often, but it does happen.

    The tests works as expected when the first time() runs prior to the sleep().
    Unfortunately, there is no guarantee that scheduler will cooperate and schedule
    the parent first.

    Schematically, we believe the following occurs:

    Child Parent

    Sleep 1 wait to be scheduled
    -- | |
    ^ | |
    1 | | |
    T | | ................. time(&time1)
    I S | | ^ waitpid()
    M e | | | |
    E c v | < one second | |
    | __ | v |
    V exit ................. time(&time2)
    | |
    o o
    Test Output
    TEST CASE: sigignore

    TEST PURPOSE #4
    After a call to int sigignore(int sig) when the action
    for SIGCHLD is set to SIG_IGN if the calling process
    subsequently waits for its children and the process
    has no unwaited for children that were transformed
    into zombie processes it shall block until all its
    children terminate and wait(), wait3(), waitid(), and
    waitpid() shall fail and set errno to ECHILD.
    PREP: Set up action for SIGCHLD
    PREP: fork() a child that exits
    PREP: fork() a child that sleeps
    TEST: wait() returns -1 and errno = ECHILD
    TEST: wait() blocks until child exits
    PREP: fork() a child that sleeps
    TEST: waitpid() returns -1 and errno = ECHILD
    TEST: waitpid() blocks until child exits
    ERROR: waitpid() did not block
    4 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.

    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