www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/24/11:38:03

Date: Wed, 24 Jul 1996 18:32:39 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: PENG ZHOU <pengzh AT ix DOT netcom DOT com>
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: <Pine.SUN.3.91.960724182234.14565D-100000@is>
Mime-Version: 1.0

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019