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

The Open Brand -- Problem Reporting and Interpretations System


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


Report 2380 Actions


    Problem Report Number 2380
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Rejected (REJ)
    Problem Resolution ID REJ.X.0654
    Raised 2004-05-26 12:44
    Updated 2004-05-29 15:50
    Published 2004-05-29 15:50
    Product Standard Internationalised System Calls and Libraries Extended V3 (UNIX 03)
    Certification Program The Open Brand certification program
    Test Suite VSU version 5.2.5
    Test Identification CAPI.os/procenv/getrusage
    Specification Base Definitions Issue 6
    Problem Summary getrusage has problems because parent and child are using different time
    granularity functions
    Problem Text When calling getrusage(RUSAGE_SELF,buf), the values returned are
    nano-second
    granularity aggregations, but getrusage(RUSAGE_CHILDREN,buf) uses the
    times(2) function which returns values in clock-tick units, which have
    a granularity of 10 milliseconds or so.

    In the test, a parent spawns a child; the child chews up some time and
    calls getrusage(RUSAGE_SELF), yielding very accurate cpu times, which
    are passed back to the parent over a pipe. The child exits, and the
    waiting parent calls getrusage(RUSAGE_CHILDREN), getting much less
    accurate (and smaller) cpu times. The test fails because the parent
    sees smaller cpu times than the child did.
    Test Output
    ****************************************************************************************************************
    /tset/CAPI.os/procenv/getrusage/T.getrusage 2 Failed

    Test Description:
    Base Required Conformance
    A successful call to int getrusage(int who, struct rusage
    *r_usage)
    when who is RUSAGE_CHILDREN shall place the user and system time
    used
    by the terminated and waited-for children of the calling process
    into
    the ru_utime and ru_stime members, respectively, of the rusage
    structure pointed to by r_usage and return 0.

    Test Information:
    PREP: Fork a child process and consume CPU time
    PREP: (child) Call getrusage(RUSAGE_SELF) and send data to
    parent
    PREP: Receive getrusage data from child
    TEST: getrusage(RUSAGE_CHILDREN) gives same or slightly more
    user time
    as sent by child
    ERROR: getrusage() did not return the correct user time
    Expected tv_sec: 0 Received: 0
    Expected tv_usec: 226279 Received: 220000
    TEST: getrusage(RUSAGE_CHILDREN) gives same or slightly more
    system time
    as sent by child
    ERROR: getrusage() did not return the correct system time
    Expected tv_sec: 0 Received: 0
    Expected tv_usec: 104257 Received: 100000


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


    ****************************************************************************************************************
    /tset/CAPI.os/procenv/getrusage/T.getrusage 3 Failed

    Test Description:
    Base Required Conformance
    A successful call to int getrusage(int who, struct rusage
    *r_usage)
    when who is RUSAGE_CHILDREN shall not include resource
    information for
    child processes which are never waited for.

    Test Information:
    PREP: Set SIGCHLD to SIG_DFL with sa_flags=0
    PREP: Fork a child process and consume CPU time
    PREP: Parent: Do not wait for child to exit
    TEST: Call to getrusage does not obtain the user
    and system time used by the child process
    which is not waited for
    PREP: Set SIGCHLD to SIG_DFL with sa_flags=SA_NOCLDWAIT
    PREP: Fork a child process and consume CPU time
    PREP: Parent: Do not wait for child to exit
    TEST: Call to getrusage does not obtain the user
    and system time used by the child process
    which is not waited for
    ERROR: getrusage() did not return the correct
    seconds value for user time
    Expected: 0 Received: 8
    PREP: Set SIGCHLD to SIG_IGN with sa_flags=0
    PREP: Fork a child process and consume CPU time
    PREP: Parent: Do not wait for child to exit
    TEST: Call to getrusage does not obtain the user
    and system time used by the child process
    which is not waited for
    ERROR: getrusage() did not return the correct
    seconds value for user time
    Expected: 0 Received: 17


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

    Review Information

    Review Type TSMA Review
    Start Date 2004-05-26 12:44
    Last Updated 2004-05-26 19:54
    Completed 2004-05-26 19:54
    Status Complete
    Review Recommendation Rejected (REJ)
    Review Response These two tests are not failing for the same reason.

    The test 2 failure is explained by the submitters rationale, and a TSD
    for this failure should be issued if requested separately.

    The test 3 failure shows an expected child user time of 0 and an actual
    time of several seconds in two of the three parts of the test.
    Apparently getrusage() is including resource information for terminated
    children that have not been waited for, when SIGCHLD is either ignored
    or has the SA_NOCLDWAIT flag set. The specification for getrusage()
    states that resource information for terminated children must be
    discarded in these cases.

    Review Type SA Review
    Start Date 2004-05-26 18:54
    Last Updated 2004-05-27 01:07
    Completed 2004-05-27 01:07
    Status Complete
    Review Resolution Rejected (REJ)
    Review Conclusion The TSMA has advised that while a TSD is appropriate for test 2, this
    is not the case for test 3. The SA confirms that the specification
    requires:

    "If the child is never waited for (for example, if the parent has
    SA_NOCLDWAIT set or sets SIGCHLD to SIG_IGN), the resource information
    for the child process is discarded and not included in the resource
    information provided by getrusage()"

    It would appear that the implementation is not conforming to this on
    the information provided.

    This PR is therefore rejected as a TSD, though if a PR is submitted
    for test 2 alone a TSD may be granted in this case.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority