Mail Archives: djgpp/1999/11/03/22:05:38
Antti =?iso-8859-1?Q?Koskip=E4=E4?= (antti DOT koskipaa AT nic DOT fi) wrote:
: I came across an interesting bug in my program.
: Piece of code from the main program:
: init ();
: playmidi (23);
: init_graphics ();
: This executes always in the beginning. The game loads itself
: succesfully,
: generates all tables, etc.
: All is fine until it hits the address 0x163e. Page Fault.
: I first run symify to check where it crashes. Ok. playmidi(23). I always
: check
: with fsdb what kind of instruction in at the address. It was a CALL.
: Then I comment out the call (in the C code) and try again. Now it
: crashes
: when it calls init_graphics. Again re-check. Again the CALL instruction,
: and at the same address 0x163e. (of course it is, since the previous
: call is out
: of the way) So this is not a problem with a corrupted function or
: function
: address. Next, I insert a few inline NOPs before init_graphics to be
: placed
: at the address 0x163e. Compile. Run. THE NOP CAUSES A PAGE FAULT!?
: What the h***???
: HELP! I'm frustrated!
It sounds as if the init() function destroys the stack...
Oldfield, Turbular Bells III,
MartinS
- Raw text -