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

The Open Brand -- Problem Reporting and Interpretations System


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


Report 1929 Actions


    Problem Report Number 1929
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Rejected (REJ)
    Problem Resolution ID REJ.X.0565
    Raised 2000-11-09 08:00
    Updated 2003-03-13 08:00
    Published null
    Product Standard Internationalised System Calls and Libraries Extended V2 (UNIX 98)
    Certification Program The Open Brand certification program
    Test Suite VSX5 version 5.1.5
    Test Identification MSE.os/streamio/fwide 6
    Problem Summary PG5R.008 /tset/MSE.os/streamio/fwide/T.fwide Test No : 6 This test fails when the fwide() does not report an error after a call to close() in the test suite. The Application Usage section of the close() functi...
    Problem Text
    /tset/MSE.os/streamio/fwide/T.fwide Test No : 6

    This test fails when the fwide() does not report an error after
    a call to close() in the test suite.

    The Application Usage section of the close() function
    description (CAE Specification - System Interfaces and Headers, Issue 5)
    states that:
    "An application that had used the stdio routine fopen() to
    open a file should use the corresponding fclose() routine rather
    than close()."

    In this case the test uses fopen() to open the file but uses
    close() instead of fclose() which violates the Application Usage
    guidelines for this function.

    In the ERRORS section of fwide specification:

    [EBADF]
    The stream argument is not a valid stream.

    Also, the specification says:
    "A handle which is a stream is considered to be closed when either
    an fclose() or freopen() is executed on it ..."

    In our implementation if we use fclose() to close the stream
    a call to fwide() sets error number to EBADF.

    We beleive its wrong for the test to use colse() because, while the
    stream structure (FILE) contains information about the file that
    includes the association between the stream and the file descriptor,
    the 'file descriptor' is a simple int type. Supporting the
    bi-directional associations between these two file handles is not
    a stated requirement of the specification. But here the tests are
    indirectly expecting this requirement. Also, the Application Usage
    guidelines recognized this and indicated that such interaction
    would produce indeterminate results.

    Test Output
    ***********************************************************************
    /tset/MSE.os/streamio/fwide/T.fwide 6 Failed

    Test Description:
    If the implementation detects EBADF for fwide():
    When stream is not a valid stream, then a call to
    fwide(stream,mode) sets errno to EBADF.

    Test Strategy:
    CREATE a file containing the string "X\n"
    OPEN the file using fopen(file, "r")
    CLOSE the file descriptor for the stream, using
    close(fileno(fp))
    VERIFY that fwide(fp, 0) sets errno to EBADF

    Test Information:
    fwide() did not set errno


    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    The EBADF condition for fwide() is unusual in that it applies for
    conditions other than just the underlying file descriptor being
    closed (or open with the wrong access). For all other streamio
    functions, EBADF is related explicitly to the underlying file
    descriptor. For example, on the page for fgetc(), the EBADF condition
    is described as "The file descriptor underlying stream is not a valid
    file descriptor open for reading." This inconsistency of fwide() with
    other streamio functions has been queried with the Base Working Group,
    and they confirmed that it is intended.

    The only way to test EBADF for streamio functions other than fwide()
    is to close the underlying file descriptor (and perhaps open it again
    with the wrong access). There is no reason not to use the same method
    for fwide(). Indeed, although fwide() is allowed to return an EBADF
    error under other conditions as well, this is the only one for which a
    portable test method exists. It is not possible to use fclose(),
    since the specification states "After the call to fclose(), any use of
    stream causes undefined behaviour."

    The reason that this test has failed is because the configuration
    parameter VSX5_FWIDE_EBADF has been set to "Y" to indicate that
    the implementation detects EBADF for fwide(). The solution is
    to redefine the meaning of this parameter so that, rather than
    indicating "the implementation detects EBADF for fwide()", it
    indicates "the implementation detects EBADF for fwide() when the
    file descriptor underlying the stream is closed". This change
    will be made to the VSX5 documentation in the next release.

    It is recommended that this request is refused, and that test agencies
    are given permission for VSX5_FWIDE_EBADF to be set to "N" when testing
    systems where fwide() does not detect EBADF in the case that the file
    descriptor underlying the stream is closed, even if the CSQ for the
    system says that EBADF is detected by fwide().

    Review Type SA Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution Rejected (REJ)
    Review Conclusion
    This request is refused.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority