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

The Open Brand -- Problem Reporting and Interpretations System


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


Report 2087 Actions


    Problem Report Number 2087
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Test Suite Deficiency (TSD)
    Problem Resolution ID TSD.X.1058
    Raised 1970-01-01 08:00
    Updated 2003-03-13 08:00
    Published 1998-05-16 08:00
    Product Standard Internationalised System Calls and Libraries Extended V2 (UNIX 98)
    Certification Program The Open Brand certification program
    Test Suite VSTH version 5.1.2
    Test Identification PTHR.os/all/readdir_r 5
    Problem Summary TSD5TH.00055 The failure noted above is for PTHR.os/all/readdir_r/T.readdir_r, test 5. If the implementation of readdir_r supports detection of EBADF as determined by VSX_READDIR_EBADF in tetexec.cfg, the test att...
    Problem Text
    The failure noted above is for PTHR.os/all/readdir_r/T.readdir_r,
    test 5. If the implementation of readdir_r supports detection of
    EBADF as determined by VSX_READDIR_EBADF in tetexec.cfg, the test
    attempts to verify this error condition.

    Basically, the test does the following:

    dirp = opendir(".");




    closedir(dirp);
    rval = readdir_r(dirp, pentry, &result);

    The closedir() function not only closes the file descriptor
    associated with "dirp" but also frees memory for "dirp"
    allocated by opendir().

    As stated in the XSH5 closedir() description:

    Upon return, the value of "dirp" may no longer point to an
    accessible object of the type DIR.

    After the call to closedir(), "dirp" is just a pointer, and it no
    longer points to an informative object in our implementation. As
    a result, the readdir_r() function cannot detect if "dirp" refers
    to an open directory stream. Moreover, while trying to validate
    "dirp", since the function accesses the contents of "dirp", it
    results in a core dump.

    For reference, the following is the outline of a similar test for
    readdir test case 10 (./tset/POSIX.os/files/readdir/T.readdir):

    for (i = 0; i < open_max; i++)
    fdtab[i] = fcntl(i, F_GETFD);

    dirp2 = opendir(".");
    dir_fd = -1;
    for (i = 0; i < open_max; i++) {
    if (fdtab[i] == -1 && fcntl(i, GETFD) != -1) {
    dir_fd = i;
    break;
    }
    }
    close(dir_fd);
    rval = readdir(dirp2);

    In this case, the test only closes the file descriptor associated
    with "dirp2" before calling readdir(). The VSTH readdir_r test
    should be updated to be consistant with the VSX readdir method for
    testing the EBADF condition.

    Test Output

    400|1634 5 1 10:37:25|IC Start
    200|1634 5 10:37:25|TP Start
    520|1634 5 00013919 1 1|If the feature test macro _POSIX_THREAD_SAFE_FUNCTIONS i
    s defined:
    520|1634 5 00013919 1 2|when the implementation detects that the directory strea
    m referenced
    520|1634 5 00013919 1 3|by dirp does not refer to an open directory stream,
    520|1634 5 00013919 1 4|then a call to readdir_r(dirp, entry, result) shall fail
    and
    520|1634 5 00013919 1 5|return EBADF.
    520|1634 5 00013919 1 6|Posix Ref: Component READDIR_R
    520|1634 5 00013919 1 7|Assertion 9945-1:1996 5.1.2.3, 9945-1:1996 5.1.2.4-5(C)
    510|1634|system 0: Abandoning testset: caught unexpected signal 11 (SIGSEGV)
    220|1634 5 7 10:37:26|NORESULT (auto-generated by TCC)
    80|1634 1 10:37:26|TC End, scenario ref 1656-

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    We agree with the applicant and recommend that a waiver be
    granted on the basis of a test suite deficiency.

    It should be noted that the solution proposed by the applicant
    is specific to implementions for which a file descriptor




    underlies the implementation of a directory handle and is
    not a general solution to this testing problem.


    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