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

The Open Brand -- Problem Reporting and Interpretations System


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


Report 1305 Actions


    Problem Report Number 1305
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Test Suite Deficiency (TSD)
    Problem Resolution ID TSD.X.0587
    Raised 1970-01-01 08:00
    Updated 2003-03-13 08:00
    Published 1998-06-05 08:00
    Product Standard Internationalised System Calls and Libraries Extended V2 (UNIX 98)
    Certification Program The Open Brand certification program
    Test Suite VSU version 5.0.2
    Test Identification CAPIbase/fgetmsg 28,29
    Problem Summary TSD4U.00231 This request reports problems with passing these tests on STREAMS which are ptys.
    Problem Text
    In the System Interface Definition, Issue 5 (page 26), the definition of
    pseudo-terminal indicates that the slave device provides processes with
    an interface that is identical to the terminal interface. A similar
    statement is not made for the master side. Since the slave device
    provides processes with an interface identical to the terminal interface,
    the slave device can detect a terminal disconnect or the hangup state
    when the master side of the pseudo-tty interface is closed. The failing
    test cases indicated above close the slave device expecting that
    the master side will detect the terminal disconnect or hangup state.
    This fails on our implementation because the master side does not provide
    the terminal interface. This behavior is correct.

    The tests should be modified to write on the master side and read/readv/
    getmsg/getpmsg/poll on slave side. The close should then be done on the
    master side at which point the slave side would be expected to detect
    the terminal disconnect or hangup state.

    This is inclusive of the following test cases:

    getmsg 28,29
    getpmsg 29,30
    poll 14,16
    read 16
    freadv 39

    ************************************************
    This request has been refused as PG4U.00141, and we wish to appeal
    appeal against this decision.

    Our further argument in support of this is as follows:-

    In all the above failure cases the slave (write end of the STREAM)
    side of the pseudo-terminal is closed to generate the hangup state at the
    master end.


    For example, following is the code segment from fgetmsg28.c (line 147 onward)

    Test Output
    TEST CASE: getmsg

    TEST PURPOSE #28
    A call to int getmsg(int fildes, struct strbuf
    *ctlptr, struct strbuf *dataptr, int *flagsp) when a
    hangup occurs on a STREAM from which messages are
    being read shall continue to operate normally until
    the STREAM head read queue is empty.
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Ignore SIGPOLL, SIGHUP, and SIGPIPE signals
    PREP: Set O_NONBLOCK on read end of STREAM
    PREP: Set O_NONBLOCK on write end of STREAM
    PREP: Put some messages on the STREAM
    PREP: Hangup write end of STREAM
    ERROR: Test took longer than 600 seconds: presuming
    function is hung and terminating test
    28 FAIL


    TEST PURPOSE #29
    A call to int getmsg(int fildes, struct strbuf
    *ctlptr, struct strbuf *dataptr, int *flagsp) when a
    hangup occurs on a STREAM from which messages are
    being read shall return 0 in the len member of the
    structures pointed to by ctlptr and dataptr after the
    STREAM head read queue is empty.
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Ignore SIGPOLL, SIGHUP, and SIGPIPE signals
    PREP: Set O_NONBLOCK on read end of STREAM
    PREP: Set O_NONBLOCK on write end of STREAM
    PREP: Put a message on the STREAM
    PREP: Hangup write end of STREAM
    PREP: Read message from STREAM
    TEST: Next getmsg returns 0 in len members
    ERROR: getmsg failed, errno = 22(EINVAL - Invalid argument)
    29 FAIL


    TEST CASE: getpmsg

    TEST PURPOSE #29
    When a hangup occurs on a STREAM from which messages
    are being read, calls to the function int getpmsg(int
    fildes, struct strbuf *ctlptr, struct strbuf *dataptr,
    int *bandp, int *flagsp) shall continue to operate
    normally until the STREAM head read queue is empty.
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Ignore SIGPOLL, SIGHUP, and SIGPIPE signals
    PREP: Set O_NONBLOCK on read end of STREAM
    PREP: Set O_NONBLOCK on write end of STREAM
    PREP: Put some messages on the STREAM
    PREP: Hangup write end of STREAM
    ERROR: Test took longer than 600 seconds: presuming
    function is hung and terminating test
    29 FAIL


    TEST PURPOSE #30
    When a hangup occurs on a STREAM from which messages
    are being read, calls to int getpmsg(int fildes,
    struct strbuf *ctlptr, struct strbuf *dataptr, int
    *bandp, int *flagsp) shall return 0 in the len member
    of both the data and control buffers once the STREAM
    head read queue is empty.
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Ignore SIGPOLL, SIGHUP, and SIGPIPE signals
    PREP: Set O_NONBLOCK on read end of STREAM
    PREP: Set O_NONBLOCK on write end of STREAM
    PREP: Put a message on the STREAM
    PREP: Hangup write end of STREAM
    PREP: Read message from STREAM
    TEST: Next getpmsg returns 0 in len members
    ERROR: ERROR: getpmsg failed, errno = 22(EINVAL - Invalid argument)
    30 FAIL


    TEST CASE: poll

    TEST PURPOSE #14
    A successful call to int poll(struct pollfd fds[],
    nfds_t nfds, int timeout) shall examine each element
    of the fds array for instances where the device
    specified by the fd member has been disconnected and
    set the POLLHUP flag in the corresponding revents
    member when found.
    PREP: Create two streams
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Close one of the descriptors to issue hangup
    TEST: poll returns number for selected file descriptors
    ERROR: poll returned incorrect value
    Expected 1
    Received 0
    14 FAIL

    TEST PURPOSE #16
    On a call to int poll(struct pollfd fds[], nfds_t
    nfds, int timeout) the setting of the POLLHUP flag
    shall not be mutually exclusive with the setting of
    the POLLIN, POLLRDNORM, POLLRDBAND or POLLPRI flags.
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Write band 0 data onto STREAM
    PREP: Now hangup write end of STREAM
    TEST: Poll for all our events at once
    TEST: POLLHUP|POLLIN set
    ERROR: POLLHUP not set in revents
    PREP: Now hangup read end of STREAM
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Write band 0 data onto STREAM
    PREP: Now hangup write end of STREAM
    TEST: Poll for all our events at once
    TEST: POLLHUP|POLLRDNORM set
    ERROR: POLLHUP not set in revents
    PREP: Now hangup read end of STREAM
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Write band 1 data onto STREAM
    PREP: Now hangup write end of STREAM
    TEST: Poll for all our events at once
    TEST: POLLHUP|POLLRDBAND set
    ERROR: POLLHUP not set in revents
    PREP: Now hangup read end of STREAM
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Write high priority message onto STREAM
    PREP: Now hangup write end of STREAM
    TEST: Poll for all our events at once
    TEST: POLLHUP|POLLPRI set
    ERROR: POLLHUP not set in revents
    16 FAIL


    TEST PURPOSE #16
    A call to ssize_t read(int fildes, void *buf, size_t
    nbyte) when fildes refers to a STREAMS file and a
    hangup occurs on the STREAM shall continue to operate
    normally until the STREAM head read queue is empty.
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Ignore SIGPOLL, SIGHUP, and SIGPIPE signals
    PREP: Set O_NONBLOCK on read end of STREAM
    PREP: Set O_NONBLOCK on write end of STREAM
    PREP: Put some messages on the STREAM
    PREP: Hangup write end of STREAM
    ERROR: Test took longer than 600 seconds: presuming
    function is hung and terminating test
    16 FAIL


    TEST CASE: freadv

    TEST PURPOSE #39
    A call to ssize_t readv(int fildes, const struct iovec
    iov, int iovcnt) when fildes refers to a STREAMS file
    and a hangup occurs on the STREAM shall continue to
    operate normally until the STREAM head read queue is
    empty.
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Ignore SIGPOLL, SIGHUP, and SIGPIPE signals
    PREP: Set O_NONBLOCK on read end of STREAM
    PREP: Set O_NONBLOCK on write end of STREAM
    PREP: Put some messages on the STREAM
    PREP: Hangup write end of STREAM
    ERROR: Test took longer than 600 seconds: presuming
    function is hung and terminating test
    39 FAIL


    TEST PURPOSE #100
    ENXIO in errno and return -1 on a call to int
    ioctl(int fildes, I_FDINSERT, struct strfdinsert *arg)
    when fildes refers to a STREAMS device and a hangup is
    received on the STREAM referenced by the fd member of
    the structure pointed to by arg.
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Setup strfdinsert structure
    PREP: Close read end to issue hangup
    TEST: ioctl returns -1
    ERROR: ioctl returned 0
    100 FAIL

    TEST CASE: ioctl

    TEST PURPOSE #100
    ENXIO in errno and return -1 on a call to int
    ioctl(int fildes, I_FDINSERT, struct strfdinsert *arg)
    when fildes refers to a STREAMS device and a hangup is
    received on the STREAM referenced by the fd member of
    the structure pointed to by arg.
    PREP: Open master pseudo tty
    PREP: Determine if pseudo tty is a stream
    PREP: Open slave side of pseudo tty
    PREP: Setup strfdinsert structure
    PREP: Close read end to issue hangup
    TEST: ioctl returns -1
    ERROR: ioctl returned 0
    100 FAIL

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    This request should be refused. The tests correctly verify the
    specification as written and the failures indicate non-conforming
    implementation behavior.

    The assertions being tested here are generic STREAMS requirements
    which have nothing to do with ptys. As such the issues about terminal
    interface emulation have no bearing on the requirements or the tests -
    all STREAMS are required to support these requirements whether they
    provide terminal interface emulation or not.

    Consider the getmsg tests for example. The specification says:

    If a hangup occurs on the STREAM from which messages are to be
    retrieved, getmsg() and getpmsg() continue to operate normally,
    as described above, until the STREAM head read queue is empty.
    Thereafter, they return 0 in the len members of ctlptr and dataptr.

    This is what the corresponding assertion states and what the corresponding
    test tests. As this is a generic requirement for all STREAMS it must be
    supported by all STREAM ends. The fact that a STREAM end being used happens
    to also be a master or slave pty has no bearing on the specification
    requirement, the assertion, or the test. The same analysis applies for
    all the other tests at issue.

    Review Type SA Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution No Resolution Given
    Review Conclusion
    The customer has appealed against the original decision. We wish
    to grant a Temporary Interpretation to expedite the matter, it should
    also go for a 14 day review by the Base Working Group.

    Review Type Expert Group Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution No Resolution Given
    Review Conclusion
    An interpretation should be granted. All of the TEST PURPOSE output
    from the failures talk about what is supposed to happen when a hangup
    occurs on a STREAM. As the submitter points out, a close of a STREAMS
    device is not required to produce a hangup condition except for the last
    close of the master side of a pseudo-terminal. The 4th paragraph from the
    bottom of XSH5 volume 1 page 135 says that the last close of the master
    side of a pseudo-terminal sends a SIGHUP to the process group for which
    the slave side is a controlling terminal (i.e. hangup occurs). I do not
    find any place in XSH5 or XBD5 where it says this happens for arbitrary
    STREAMS devices as indicated by the consultant's response. XSH5 only
    says that a hangup condition is created by closing the master side of
    a pseudo-terminal.


    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