Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!tiamat!jim From: jim@tiamat.fsc.com (Jim O'Connor) Newsgroups: comp.unix.xenix Subject: Re: system lockup Summary: something doesn't look right here Keywords: bug? Message-ID: <387@tiamat.fsc.com> Date: 15 Feb 89 15:42:46 GMT References: <60@estinc.UUCP> Organization: Filtration Sciences Corp., Chattanooga, TN Lines: 32 In article <60@estinc.UUCP>, fnf@estinc.UUCP (Fred Fish) writes: > > I had a case of a program running on a Bell Technologies MPE386, > under SCO 386 Xenix Version 2.3.1, which was causing the system > to lock up (no response to any typing on any terminal). I finally > tracked it down. This simple program demonstrates the problem > on my system: > > static char buf [1024 * 1024]; > > main () > { > write (0, buf, sizeof (buf)); > } Something doesn't look right here. Isn't this an attempt to write to "stdin" which is probably not open for writing? It seems that a return value of -1, and errno set to EBADF should be expected. As to why it hangs the system, I don't know, but it really shouldn't matter, since I don't think too many programs would be intentionally writing 1024 * 1024 NULL bytes to a file desciptor for which an attempt at opening for writing (and in this case, closing one that is already open for reading) has not been made. What program do you have that needs to do this? ------------- James B. O'Connor jim@tiamat.fsc.com Filtration Sciences Corporation 615/821-4022 x. 651 *** Altos users unite! mail to "info-altos-request@tiamat.fsc.com" ***