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

The Open Brand -- Problem Reporting and Interpretations System


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


Report 1398 Actions


    Problem Report Number 1398
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Test Suite Deficiency (TSD)
    Problem Resolution ID TSD.X.0680
    Raised 1970-01-01 08:00
    Updated 2003-03-13 08:00
    Published 1996-07-29 08:00
    Product Standard Internationalised System Calls and Libraries Extended (UNIX 95)
    Certification Program The Open Brand certification program
    Test Suite VSU version 4.1.0
    Test Identification base/readv 22
    Problem Summary TSD4U.00135 This test may fail on implementations because the baud rate is being set in a non-portable fashion directly in the c_cflag field.
    Problem Text
    Test cases: base/readv22

    The problem is in tty_init() and loop_init() functions in
    CAPI/SRC/LIB/capi_com/termios.c
    These functions correctly use tcgetattr() to
    gather values for the termios structure of the terminal.
    What seems incorrect is the setting of the c_cflags element
    in the following code snippet as the existing settings for these
    values from the previous tcgetattr() call are ignored:

    (termios_p)->c_iflag = (IGNPAR|IGNBRK|ISTRIP|ICRNL);
    (termios_p)->c_oflag = OPOST;
    (termios_p)->c_cflag = (CLOCAL|CREAD|CS8|B9600);
    (termios_p)->c_lflag = (ISIG|ICANON);

    In fact any of these could wind up causing an EINVAL or invalid
    argument. These are found on lines 177-180 and on lines 243-246
    of termios.c
    On our system it is the setting of the baud rate with the following
    statement that causes the EINVAL errno: (also in loop_init).

    (termios_p)->c_cflag = (CLOCAL|CREAD|CS8|B9600);

    Here is the first rationale:
    >From the tcgetattr()/tcsetattr() definition (page 144, lines 642ff):

    The effect of the tcsetattr() function is undefined if the value
    of the termios structure pointed to by termios_p was not derived
    from the result of a call to tcgetattr() on fildes...

    While, strictly speaking, they are "derived" from the result of a
    tcgetattr, this overlays bits of which they have no knowledge
    (PACKET, PKT3270, PKTXTND, PTU3270 in c_cflag). Thus system
    specific bits could be turned off inadvertently with this method
    of specifying c_cflag settings.

    Here is the second rationale:
    On setting baud rates - in the rationale section for the cfXetXspeed
    functions (page 281, lines 4068ff):

    In historical implementations, the baud rate information is
    traditionally kept in c_cflag. Applications should not be written
    to presume that this might be the case (and thus not blindly copy
    c_cflag) but not rely on it, in case it is in some other field in
    the structure. Setting c_cflag field absolutely after setting a
    baud rate is a nonportable action because of this.

    If the settings of c_cflag were set absolutely rather than ORing
    "on" the desired settings, this would probably work for most
    implementations. However we feel that the
    baud rates should be set by cfsetXspeed functions as a minimum.
    When we removed the ... | B9600 ... from the statements above,
    the tcsetattr() function succeeds.

    Additional comments on this test:
    There is no explicit requirement for physical terminal ports
    in the specification. Thus to require that physical ports be
    wired together in a loopback presumes the existence of
    physical terminal ports which are not required by the specification.
    Can X/Open comment on this without an additional interpretation
    request?
    Test Output
    TEST PURPOSE #22
    10|1 /tset/CAPIbase/freadv/freadv22 12:51:10|TC Start, scenario ref 0-1
    15|1 1.10 1|TCM Start
    400|1 22 1 12:51:12|IC Start
    200|1 1 12:51:12|TP Start
    520|1 1 24903705 1 1|SPEC1170TESTSUITE CASE 22
    520|1 1 24903705 1 2|A call to ssize_t readv(int fildes, const struct iovec
    520|1 1 24903705 1 3|*iov, int iovcnt) when the function is interrupted by
    520|1 1 24903705 1 4|a signal after it has successfully read some data
    520|1 1 24903705 1 5|shall return the number of bytes read.
    520|1 1 6029323 1 1|PREP: Read IOV_MAX system configuration
    520|1 1 6029323 1 2|PREP: Allocate and initialize I/O buffers
    520|1 1 16711720 1 1|PREP: Open and initialize the terminal files
    520|1 1 16711720 1 2|ERROR: tty_prep: tcsetattr call failed, errno = 121
    (EINVAL - Invalid argument)
    520|1 1 16711720 1 3|ERROR: Termios_prep failed
    520|1 1 6029323 2 1|CLEANUP: Free iovec buffers
    220|1 1 1 12:51:12|FAIL

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    We agree this is a test suite deficiency in the test
    suite version(s) listed.

    IRs are single issue items. This makes searching for rulings related
    to particular issues possible when checking final rulings. Please file
    an SR (or IR if appropriate) on your secondary question about the
    requirement for physical terminal ports.

    Review Type SA Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution No Resolution Given
    Review Conclusion
    Please note the consultant's comments about filing another request for
    the second issue.

    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