Date: Wed, 24 Jul 1996 18:32:39 +0200 (IST) From: Eli Zaretskii To: PENG ZHOU Cc: djgpp AT delorie DOT com Subject: Re: C Program crashes in Djgpp In-Reply-To: <4t3hfa$p5n@sjx-ixn6.ix.netcom.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 23 Jul 1996, PENG ZHOU wrote: > My program fileread.c which works ok with my MSC but crashes with > some general protection faults in DJGPP. Don't know why. This is not the effective way (IMHO) to solve your problems. When your program crashes, run symify, like this: symify myprog (replace `myprog' with the actual name of your program, but WITHOUT the .exe extension). Symify will then convert the cryptic stack dump which gets printed on the screen into a human-readable list of source files and line numbers that will pinpoint to you where the program crashed. You can then look at those lines and try to understand why does it crash. If you cannot figure out what's wrong with your code, run it under debugger and print values of important variables. Only if all this doesn't give you a clue, post here, and always include the stack dump printed when the program crashes, after running symify on it (symify has a switch to redirect the output to a file). More details about using symify can be found in section 9.2 of the DJGPP FAQ list (v2/faq201b.zip from the same place you get DJGPP); you should read it if you never before used symify. > This program might have a few bugs but it runs ok in MSC, compiles ok > in DJGPP but crashes when runned. DJGPP is a protected-mode environment, so it won't let you access illegal addresses that MSC would. Buggy programs have much higher chance to crash in DJGPP than in any real-mode compiler.