Mail Archives: djgpp/1996/11/12/19:48:07
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 <progname>', where <progname> 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. |
---------------------------------------------------------------------
- Raw text -