Date: Sun, 1 May 94 01:22:48 +0100 From: acc AT asterix DOT inescn DOT pt (Antonio Costa) To: djgpp AT sun DOT soe DOT clarkson DOT edu, morphine AT whatever DOT cs DOT jhu DOT edu Subject: Re: Segmentation violation > I've been compiling several programs over the past day to test out gcc, >and sometimes I can get a program to compile fine, but when I run it, I get a >message like > "Segmentation violation in pointer 0x00000010 at d8:5c9d > (register values) > Call frame traceback EIPs: > 0x00005c9d > 0x00001e7a > 0x00001702 > 0x0000121d > " > >First of all, what exactly does this mean? Second, what can I do to keep it It shows all the functions called at the time your program crashed. If you compile with option -g (like gcc -g ...), then you can do symify to see all the invoked functions and the source lines associated with them... >from happening. It doesn't matter whether I use the coff2exe program or run it >with go32, some programs simply show this error without hardly even starting. >There are only two things I have been able to come up with that are consistent >with all programs that crash this way: 1) they use pointers, and 2) they access >files. I haven't tried isolating them further (ie, to find out if it is just >with files, or happens with all kinds of pointers). Suggestions? (It compiles >correctly on two other compilers.) This does not mean your programs are correct. I can give you some examples of programs that compile and seem to run fine under BC 3.1 (which I sometimes use), but crash under DJGPP. Because DJGPP does memory management (checking if pointer references are valid, etc) and 16 bit compilers don't, many bugs don't show up under these compilers. The symptoms are well known -- a program seems to work fine, but someday you make some changes that don't add new bugs and the program starts to behave erratically or the computer hangs with no apparent reason... So, my suggestion is to compile with debug info (-g) and use symify to track down the bug. Regards, Antonio. ......................................................................... O O / / I N E S C | O | Antonio Costa | E-Mail acc AT asterix DOT inescn DOT pt | |\ | O | acosta AT porto DOT inescn DOT pt | | \ | / O Comp. Graphics & CAD | DECnet porto::acosta | | \| / / | | | / | | Largo Mompilher 22 | UUCP {mcvax,...}!... O | |-O | | 4100 Porto PORTUGAL | Bell +351+02+321006 / \ / \ O O O "Let the good times roll..."