randy@erik.UUCP (Randy Brown) (02/13/91)
This was posted to xbugs. X Window System Bug Report xbugs@expo.lcs.mit.edu VERSION: R4 CLIENT MACHINE and OPERATING SYSTEM: any with -DSTREAMSCONN--first seen on Motorola Delta 3600 with Unix System V Release 3.0 version SVR5. DISPLAY TYPE: irrelevant--first seen on a server connected through the loopback TCP/IP address 127.1, which used Streams on the cited OS. WINDOW MANAGER: irrelevant AREA: Xlib (./mit/lib/X/XlibInt.c) SYNOPSIS: The routines in lib/X/XlibInt.c for emulation of readv/writev, _XReadV() and _XWriteV(), can deliver data out of sequence when an error occurs, especially when blocking would occur. DESCRIPTION: When the STREAMSCONN versions of readv/writev encounter an error in one of the individual reads or writes used to perform the emulation, instead of returning the number of bytes transferred so far, the current iovec element is skipped. No return occurs until all elements of iovec have been attempted. Then the number of bytes (total) transferred is returned. The next attempt at data transfer will begin at this offset from the beginning of the catenated data in the iovec; some of this data may not have been transferred, and some of the data requested to be transferred may have been transferred previously. As blocking (EWOULDBLOCK) is a common transitory error, it is particularly likely to evoke this bug. During a large transfer, a stream can block and unblock several times, wreaking havoc with the data transmission. REPEAT BY: This occurred when transferring an image large enough to cause blocking to occur by filling all available Streams data blocks. SAMPLE FIX: *** XlibInt.c- Mon Dec 11 20:00:00 1989 --- XlibInt.c Wed Sep 26 09:13:51 1990 *************** *** 1725,1731 **** len -= rc; size += rc; } else if (rc < 0) { ! break; } } } --- 1725,1735 ---- len -= rc; size += rc; } else if (rc < 0) { ! #ifdef DEBUG ! if (i != n) ! fprintf (stderr, "_XReadV: avoiding sequence error\n" ); ! #endif ! return (size > 0) ? size : rc; } } } *************** *** 1762,1768 **** len -= rc; size += rc; } else if (rc < 0) { ! break; } } } --- 1766,1776 ---- len -= rc; size += rc; } else if (rc < 0) { ! #ifdef DEBUG ! if (i != n) ! fprintf (stderr, "_XWriteV: avoiding sequence error\n" ); ! #endif ! return (size > 0) ? size : rc; } } }
luj@gus19.ecn.purdue.edu (Jun Lu) (02/14/91)
In article <9102122238.AA18585@erik.uucp> randy@erik.UUCP (Randy Brown) writes: > >REPEAT BY: > This occurred when transferring an image large enough to cause > blocking to occur by filling all available Streams data blocks. Great. It explains why I got server crashes when using xloadimage and hitting 'n' too quickly on a Sun3/sparc ! -- -- Jun Lu Internet:luj@ecn.purdue.edu -- -- Aeronautics & Astronautics Bitnet: luj%ecn.purdue.edu@purccvm -- -- Purdue University UUCP: pur-ee!luj -- -- W. Lafayette, IN 47907 Phone:317-494-9410 Fax:317-494-0307 --