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

The Open Brand -- Problem Reporting and Interpretations System


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


Report 2381 Actions


    Problem Report Number 2381
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Rejected (REJ)
    Problem Resolution ID REJ.X.0655
    Raised 2004-05-26 12:51
    Updated 2004-05-29 15:51
    Published 2004-05-29 15:51
    Product Standard Internationalised System Calls and Libraries Extended V3 (UNIX 03)
    Certification Program The Open Brand certification program
    Test Suite VSX4 version 4.6.2
    Test Identification POSIX.os/procenv/times 3
    POSIX.os/procenv/times 5
    Specification Base Definitions Issue 6
    Problem Summary use_time() function may be optimized away causing test timing failures
    Problem Text The problem is that our compiler optimizes away the body of the VSX
    use_time() function in some of its optimization modes. This
    optimization is legal because function body does not generate
    any events, does not modify any external values, and returns nothing
    in its scope. It is truly a "do nothing" function.

    The original use_time() code is:

    void use_time(void)
    {
    int i;
    unsigned int dummy = 0;

    for (i = 0; i < 1000; i++)
    dummy = dummy + i / (dummy + 1) * (dummy % 3);
    }

    A suggested fix is:

    #include <stdlib.h>
    unsigned int use_time_no_opt(void)
    {
    int i;
    unsigned int dummy = rand();

    for (i = 0; i < 1000; i++)
    dummy = dummy + i / (dummy + 1) * (dummy % 3);
    return dummy;
    }
    Test Output
    ************************************************************************
    /tset/POSIX.os/procenv/times/T.times 3 Failed

    Test Description:
    Increase of tms_utime as CPU time is used while executing
    instructions
    in the user space of the calling process.
    Posix Ref: Component TIMES Assertion 4.5.2.2-07(A)

    Test Strategy:
    CALL times()
    EXECUTE user code in loop, using use_time()
    CALL times()
    VERIFY that tms_utime value has increased

    Test Information:
    tms_utime (as returned by times()) does not seem to change
    observed current time: 0, observed past time: 0


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


    ************************************************************************
    /tset/POSIX.os/procenv/times/T.times 5 Uninitiated

    Test Description:
    Setting of tms_cutime to the sum of the tms_utime and tms-cutime
    of
    the calling process's terminated child processes for which it
    has
    executed a wait() or waitpid().
    Posix Ref: Component TIMES Assertion 4.5.2.2-09(A)

    Test Information:
    depends on success of test 3


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

    Review Information

    Review Type TSMA Review
    Start Date 2004-05-26 12:51
    Last Updated 2004-05-26 20:05
    Completed 2004-05-26 20:05
    Status Complete
    Review Recommendation Rejected (REJ)
    Review Response The use_time() function is a user-supplied function in userintf.c. If
    the supplied default version is not suitable, then it can be modified by
    the user as necessary.

    The suggested change would not be possible as it alters the return type
    of the function. However, an alternative change (e.g. updating a global
    variable) would also cure the problem.

    Review Type SA Review
    Start Date 2004-05-26 19:05
    Last Updated 2004-05-27 00:54
    Completed 2004-05-27 00:54
    Status Complete
    Review Resolution Rejected (REJ)
    Review Conclusion The use_time() function is a user-supplied function in userintf.c. If
    the supplied default version is not suitable, then it can be modified
    by the user as necessary.

    The suggested change would not be possible as it alters the return
    type of the function. However, an alternative change (e.g. updating a
    global variable) would also cure the problem.

    A TSD is not required to authorize the change, it should merely be
    noted in the covering letter to the application. Thus this PR is
    rejected as a test suite deficiency.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority