Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!ucbvax!CANNON.CS.USU.EDU!scott From: scott@CANNON.CS.USU.EDU (Scott Cannon) Newsgroups: comp.sys.transputer Subject: bugs in LSC Message-ID: <9008302043.AA02820@cannon.cs.usu.edu> Date: 30 Aug 90 20:43:18 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 14 The following bugs/quirks/features in Logical Systems C were recently documented by a group of graduate students. I've not verified them so some may not be completely valid or simply improper use of the library. Has anyone else seen these problems? I believe the version was 88.4 and these bugs may have been fixed in later versions. The bugs were noted while developing software on a CSA transputer board with 4 T800 nodes @ 1MB ea. using a boo4 and hosted by a HP AT-class PC: A. Multiple ChanIn() calls don't receive the exact number of bytes sent in the corresponding ChanOut() call. For example, a 4-byte ChanOut() read with a 1-byte ChanIn() followed by a 3-byte ChanIn() will drop the first byte and may produce garbage in the last byte. SOLUTION: use ChanIn() calls of the same number of bytes OR multiple 1-byte ChanIn() calls also seem to work. B. According to documentation, ProcAlt() blocks the calling process until one of the channels in its parameter list is ready. Instead, ProcAlt() immediately returns with an index into the NULL channel in its parameter list if no channel is ready. SOLUTION: put a while loop around any ProcAlt() calls which checks for the NULL index. C. ChanOutTimeFail() should clear the output channel and return control to the calling program if it is unable to send the data in the given time. The function returns control, but sometimes leaves the first byte it was trying to send in the channel. SOLUTION: have any such calls send a header of some sort instead of actual data. On the receive side, have the ChanIn() call ingore any headers that may have piled up in the channel. D. Garbage data is sometimes sent up the boot channels when a child process ends. SOLUTION: always end a process with ProcStop() rather that simply falling through. E. fprintf() refuses to write a 0 byte to a file even if the file was opened with mode "wb". SOLUTION: use fwrite(). Scott R. Cannon, Ph.D. Utah State Univ. scott@cannon.cs.usu.edu