Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!tut.cis.ohio-state.edu!ucsd!hub.ucsb.edu!orange!brian From: brian@orange.ucsb.edu (Brian Mak) Newsgroups: comp.lang.c Subject: WEIRD BUG ABOUT EXIT Message-ID: <6031@hub.ucsb.edu> Date: 30 Jul 90 05:59:17 GMT Sender: news@hub.ucsb.edu Reply-To: brian@orange.ucsb.edu (Brian Mak) Distribution: na Organization: University of California, Santa Barbara Lines: 22 I encounter a weird bug at the end of my program. I got a segmentation fault right at the closing bracket of the main(). i.e. if line 1: main() line 2: { . . . line N: } the faults occurs right at line N. But if I put exit(0) before line N, it exits without error! The only reason I may think of is that the address holding STOP of the main() is somehow overwritten by the program. But does anyone of you may think of probable reasons for that? Or does anyone has encountered such error before? Please reply both to me personally and to the newsgroup. Brian MAK