|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1566 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 1566.
Report 1566 Actions
Problem Report Number 1566 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.0848 Raised 2002-01-16 08:00 Updated 2003-03-13 08:00 Published 2002-01-23 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.1.2 Test Identification CAPI.os/streams/ioctl 22 Problem Summary TSD4U.00309 The test makes assumptions about STREAMS flow control that may not be valid on multiprocessor systems. Problem Text
This test was updated to address TSD4U.00226. In doing so, rather than
addressing the root of the problem, it instead resulted in a suppression of the
symptoms.
This test is unreliable on multiprocessor systems. Specifically, the test
asserts that successfully flushing one band and not another can be demonstrated
by flow control still being applied on the un-flushed band. This can be invalid
assumption as STREAMS flow control is advisory, and an implementation can choose
to change its flow control parameters based on its resources, including opening
flow control to suit memory conditions after arbitrary flushes. The dynamic
change in flow control conditions is well permitted by the specifications.
On our implementation, a short lock cycle mechanism is used for implementing
flush() to improve MP scalability. Thus, on MP systems, this type of a test-case
failure can occur when the implementation opens a window where another processor
might see this temporary change in flow control condition. This test does not
fail on a UP system. Note that the implementation STREAM head does honor flow
control, but if the flow control changes (the implementation, module or driver
turns it off for any reason), then applications again will be free to write to
the stream
The test needs to show that a flush of one band did not flush another by showing
that the messages on the un-flushed band are still intact, and not that flow
control state is still intact. The test instead assumes that it is the ONLY
thread that can change the flow control state by issuing the flush, and that the
flow control state will ONLY change on the flushed band, and not the un-flushed
band. After filling a stream, if it can write again, the test is assuming an
error has occurred. Since flow control is advisory, it should neither be
assumed nor asserted. Furthermore, while writes may be tied to flow control
states in the module / driver, an implementation could tie flow control to system
resources.
To more optimally test flushband, the test should write MARKED messages
(messages that have a payload that indicates band and count) into the
appropriate band of a STREAMS pipe or FIFO, and without reading, flush a band.
The test can then read the messages and check the payload values to verify that
it has read all the messages on un-flushed bands, and not read any messages on
the flushed bands.
Note that any test that depends on flow control to test other functionality
could potentially face the same problem. A more portable solution would be to
disassociate flow control from the tests except when testing flow control
itself.
A suggested fix for this assertion:
...
if ( pipe( fildes ) < 0 ) {
printf ("pipe creation failed \n");
return;
}
printf("PREP: Set O_NONBLOCK on both ends of the STREAM\n");
if((result=fcntl(fildes[0], F_GETFL)) == -1) {
perror("fcntl");
exit(1);
}
if(fcntl(fildes[0], F_SETFL, result|O_NONBLOCK) == -1) {
perror("fcntl");
exit(1);
}
if((result=fcntl(fildes[1], F_GETFL)) == -1) {
perror("fcntl");
exit(1);
}
if(fcntl(fildes[1], F_SETFL, result|O_NONBLOCK) == -1) {
perror("fcntl");
exit(1);
}
/*
* Snip -----x-----Snip code
*/
/*test write queue flushing*/
/* Start counter i with 1 so that we can identify the
* payload with as the ith message.
*/
printf("PREP: Fill band 1 write queue of one end\n");
for(i=1;i<5;++) {
memset(ctlbuf, i, sizeof(ctlbuf));
ctl.buf = ctlbuf;
ctl.len = sizeof(ctlbuf);
memset(databuf,i, sizeof(databuf));
data.buf = databuf;
data.len = sizeof(databuf);
band = 1;
flags = MSG_BAND;
if((result = putpmsg(fildes[1], &ctl, &data, band, flags)) == -1) {
break;
}
}
printf("INFO: %d messages were written to fill the STREAM\n", i-1 );
if (flush) {
printf("TEST: Flush of band 0 on that end returns other than -1\n");
binfo.bi_flag = FLUSHRW;
binfo.bi_pri = 0;
if((result = ioctl(fildes[0], I_FLUSHBAND, &binfo)) == -1) {
perror("ioctl");
exit(1);
}
}
printf("TEST: Write queue for band 1 on that end is still full\n");
for (c=1;c<5;c++) {
memset(ctlbuf, 0, sizeof(ctlbuf));
ctl.buf = ctlbuf;
ctl.maxlen = sizeof(ctlbuf);
ctl.len = 0;
memset(databuf, 0, sizeof(databuf));
data.buf = databuf;
data.maxlen = sizeof(ctlbuf);
data.len = 0;
flags = MSG_BAND;
band = 1;
errno = 0;
if((result = getpmsg(fildes[0], &ctl, &data,&band, &flags))
!= -1) {
if (databuf[0] != c)
printf("ERROR: Message received is not right\n");
}
else {
break;
}
sleep(sleeptime);
}
if (c != (i-1))
printf("ERROR: Data in band 1 may have been flushed\n");
printf("count received = %d\n",c );
...Test Output
10|0 /tset/CAPI.os/streams/ioctl/T.ioctl 16:20:06|TC Start, scenario ref 1-0, IC
s: {22}
15|0 3.3-lite 1|TCM Start
400|0 22 1 16:20:06|IC Start
200|0 22 16:20:06|TP Start
520|0 22 00009143 1 1|PREP: Set O_NONBLOCK on both ends of the STREAM
520|0 22 00009143 1 2|PREP: Put a message on band 1 of one end
520|0 22 00009143 1 3|TEST: Flush of band 0 on the other end returns other than
-1
520|0 22 00009143 1 4|TEST: Band 1 read queue still contains the message
520|0 22 00009143 1 5|PREP: Put a message on band 1 on one end
520|0 22 00009143 1 6|TEST: Flush of band 1 on the other end returns other than
-1
520|0 22 00009143 1 7|TEST: Flush of band 1 flushed the message
520|0 22 00009143 1 8|PREP: Fill band 1 write queue of one end
520|0 22 00009143 1 9|INFO: 4 messages were written to fill the STREAM
520|0 22 00009143 1 10|TEST: Flush of band 0 on that end returns other than -1
520|0 22 00009143 1 11|TEST: Write queue for band 1 on that end is still full
520|0 22 00009143 1 12|ERROR: Data in write queue for band 1 was flushed
520|0 22 00009143 1 13|TEST: Flush of band 1 returns other than -1
520|0 22 00009143 1 14|TEST: Flush of band 1 flushed write queue
220|0 22 1 16:20:26|FAIL
410|0 22 1 16:20:26|IC End
80|0 0 16:20:27|TC End, scenario ref 1-0
900|16:20:27|TCC EndReview 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.
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:
- View Report 1566
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority