Path: utzoo!attcan!uunet!snorkelwacker!apple!goofy.apple.com!chesley From: chesley@goofy.apple.com (Harry Chesley) Newsgroups: comp.sys.mac.programmer Subject: Re: FSRead hangs on the serial driver Message-ID: <6155@internal.Apple.COM> Date: 12 Jan 90 18:37:52 GMT Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 20 References:<7770@unix.SRI.COM> <4713@hydra.gatech.EDU <6113@internal.Apple.COM> <3915@atr-la.atr.co.jp> In article <3915@atr-la.atr.co.jp> alain@atr-la.atr.co.jp (Alain de Cheveigne) writes: > I currently use a 8172 byte buffer, and I don't unset the buffer on > exit. I have never witnessed such a crash. It probably doesn't happen if you close the driver before exiting. I always deallocate the buffer, just to be paranoid. What happens is the driver keeps on putting received characters into the place it thinks the buffer is. In the meantime, however, the system has cleared out the application heap (where the buffer was allocated) and given it to the next application to allocate from. So the input characters go into an essentially random memory location in the middle of a running program. This will cause problems if you get more characters on the port, and if they happen to get stuck into a critical location for the next program. Therefore, this can cause random and unpredictable crashes some arbitrary time after the program you wrote was run. In short: a programmer's nightmare. The same situation arises in other drivers, such as MacTCP.