Mail Archives: djgpp/1999/04/02/16:39:52
Derek Gordon wrote:
>
> Dear djgpp guru:
>
> Hello - my name is Derek Gordon, and I have been using the djgpp compiler
> for some time now. A few days ago, a colleague asked me to recompile a
> c program using some new ( and larger) program constants. I did so - the
> name of the program is makeped.c, and so I typed
>
> gcc makeped.c -o makeped.exe
>
> The program compiled ok. The executable "makeped" has a command line flag,
> "n" which refers to loops in a pedigree. When I run the program with "n"
> flag, I get no errors - the program runs fine. When I run without the
> flag, I receive the following error (even though the desired output file
> is produced):
>
> General Protection Fault at eip=00004f4c
> eax=00000000 ebx=00069200 ecx=00088000 etc.
>
> What is the source of this error? How may I correct it?
It's almost surely a bug in your program. See FAQ section 9.2 for how
to interpret this dump.
At a guess, I would suspect your code assumes an argument on the command
line as argv[1]. When it isn't given, argv[1] will be NULL, and trying
to dereference that pointer will crash. But it could also be something
else entirely.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -