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

The Open Brand -- Problem Reporting and Interpretations System


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


Report 0209 Actions


    Problem Report Number 0209
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Test Suite Deficiency (TSD)
    Problem Resolution ID TSD.X.0209
    Raised 1995-05-02 08:00
    Updated 2003-03-13 08:00
    Published 1995-05-04 08:00
    Product Standard Internationalised System Calls and Libraries (XPG4)
    Certification Program The Open Brand certification program
    Test Suite VSX4 version 4.3.4
    Test Identification XPG4.os/genuts/getopt 4
    Problem Summary TSD4.209 The reason why stderr cannot be re-opened is that the suite is using freopen() in a non-portable manner. Before the freopen() is attempted, the FILE* object representing stderror is closed with fclose...
    Problem Text
    The reason why stderr cannot be re-opened is that the suite is using
    freopen() in a non-portable manner. Before the freopen() is
    attempted, the FILE* object representing stderror is closed with
    fclose(). On some platforms, this makes it impossible to re-open the
    stream. Section 4.9.5.4 of the C standard states:

    "The {freopen} function opens the file whose name is the string
    pointed to by {filename} and associates the stream pointed to
    by {stream} with it."

    A stream that has been closed can no longer be considered a valid stream
    and should not be passed to freopen(). From section 4.9.3 of the C
    standard:

    "The value of a pointer to a {FILE} object is indeterminate
    after the associated file is closed ..."

    An implementation may choose to implement streams in such a way that the
    storage previously allocated to the stream structures is no longer
    accessible. Operations on the pointer that used to point to the stream
    can cause unpredictable results.

    Only valid streams which are currently open should be passed to
    freopen(). Put another way, a file cannot be "re-opened" if it wasn't
    "open" to begin with.

    This test should be modified so that stderr is not closed before it is
    re-opened. This same misuse of freopen() is seen in other tests of
    getopt but this is the only failure obtained.
    Test Output
    /tset/XPG4.os/genuts/getopt/T.getopt 4 Unresolved

    Test Description:
    The formats of the diagnostics printed to standard error by a call to
    getopt() in the POSIX locale are as follows:
    "%s: illegal option -- %c\n", <program name>, <option character>
    "%s: option requires an argument -- %c\n", <program name>, <option
    character>

    Test Information:
    getopt() : Possibly incorrect diagnostic output to standard error:-
    Expected diagnostic output :-
    pname: illegal option -- a.
    Actual diagnostic output :-
    EDC7005E The getopt() function detected an invalid option
    character a when it was invoked from program pname ..
    Cannot re-open stderr to ./errfile

    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 and it is recommended that
    this is treated as a Test Suite Deficiency.

    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