From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg) Newsgroups: comp.os.msdos.djgpp Subject: Re: #PF, #PF, #PF... Aargh, HELP!!! Date: 3 Nov 1999 09:22:50 GMT Organization: Ericsson Erisoft AB, Sweden Lines: 37 Message-ID: <7vouta$cuf$3@antares.lu.erisoft.se> References: <381F5DB6 DOT 24AE721D AT nic DOT fi> NNTP-Posting-Host: propus-144.lu.erisoft.se X-Newsreader: TIN [version 1.2 PL2] To: djgpp AT Delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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