From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: problems running a prog. Date: Tue, 12 Nov 1996 18:43:57 -0800 Organization: Three pounds of chaos and a pinch of salt Lines: 32 Message-ID: <328935ED.100C@cs.com> References: <9611121155 DOT AA07869 AT emma DOT ruc DOT dk> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp108.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Ole Winther To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Ole Winther wrote: > > I have a gcc compiled progr., when running it I got the error message > "segment violation at pointer ... ", can anybody explain what that means and > what course such errors? (the progr. runs when compiled with BC). Your program is most likely attempting to dereference a NULL pointer. The cwsdpmi DPMI host that comes with DJGPP catches illegal dereferences, but Borland's DPMI does not; nor does Windows. This is a definite bug in your program; you should fix it or run the risk of crashing your computer. Try running your program under a debugger like gdb, which will let you see exactly where in your program the NULL pointer occurred. For a simpler technique, make sure the stack frame traceback (all that hexadecimal garbage you get when you crash) is still on the screen, and run 'symify ', where is the name of your program. Assuming that you didn't strip the executable when you compiled, this will show you the file and line number of the crash. For more information, I suggest you download and read the DJGPP Frequently Asked Questions list (v2/faq202b.zip from any SimTel site). It contains detailed and invaluable information on debugging program errors. -- --------------------------------------------------------------------- | John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com | | * Proud user of DJGPP! * | http://www.cs.com/fighteer | | ObJoke: If Bill Gates were a robber, not only would he | | shoot you, but he'd send you a bill for the bullets. | ---------------------------------------------------------------------