Sender: nate AT cartsys DOT com Message-ID: <37053889.962F1C17@cartsys.com> Date: Fri, 02 Apr 1999 13:37:13 -0800 From: Nate Eldredge X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.5 i586) MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: Runtime error for compiled c program References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com 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