Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: "Ed Federmeyer" Newsgroups: scea.yaroze.problems.pc Subject: Re: Debugging, debugging... Date: 2 Aug 1998 19:03:02 GMT Organization: Ed Federmeyer Lines: 24 Message-ID: <01bdbe48$45ce1b60$549a7095@edfhome.3com.com> References: <6pind1$ep36@scea> NNTP-Posting-Host: charlie.cns.iit.edu X-Newsreader: Microsoft Internet News 4.70.1155 Steve Spiller wrote in article <6pind1$ep36@scea>... > I did successfully run a debug version of my program and found that it was > getting a seg fault in a call to free(). Sorry I can't help with the GDB problem, but I did notice that the Yaroze does not like freeing NULL pointers, unlike most other systems, which treat free(NULL) as a NOOP. (The book "Writing Solid Code" has a good writeup on freeing NULL pointers, and he essentially thinks allowing free(NULL) to be BAD because it allows latent bugs to creep in, but that so much code would stop working if it suddenly didn't work, that it needs to be left as-is!) Anyway, since I've taken to checking for NULL before free(), my programs have become much more stable. (I can trace the root cause of WHY the pointer was NULL when I didn't think it should be, etc.). You might give it a try. EdF