Board index » delphi » Something screwy

Something screwy

Hi all you programmer gods.  I am working on a program for a porgramming
competition and have came accross some wierd bug.  It runs the procedure
game fine but when it returns it automatically jumps half way through an
unrelated procedure.  I would appreciate your help.  If you have an idea
what i can do please e-mail me.  If you need the source than e-mail me to
cause it's kinda large.  Anyway thanks a bunch,

       Jeff Clement
cleme...@cadvision.com

 

Re:Something screwy


Quote
In article <01bb3f4c.4ba835c0$680132cc@clements> |\|\arauder wrote:
>Hi all you programmer gods.  I am working on a program for a porgramming
>competition and have came accross some wierd bug.  It runs the procedure
>game fine but when it returns it automatically jumps half way through an
>unrelated procedure.  I would appreciate your help.  If you have an idea
>what i can do please e-mail me.  If you need the source than e-mail me to
>cause it's kinda large.  Anyway thanks a bunch,

Sounds like a stack related problem or moving too much data into too
small a space. If you are using inline statements or ASM blocks it could
be an unbalanced stack.  Improper number of parameters being passed to a
routine, unbalanced push/pop instructions, leaving a routine w/o proper
prolog code, etc.  

Similar symptoms could also be caused by writing to an uninitialized or
improperly initialized pointer.  If a pointer is the caused, the problem
could have occured at anytime after the routine was activated.

Hopefully your running with range {$R+} and stack {$S+} checking on while
developing and testing.  If not, try recompiling after increasing the stack
size.  Use the $M option or select options|memory.

Re:Something screwy


The stack is a good place to look. Especially if You are writing something
in assembly.
If You are using the MOVE procedure, be very careful, as this does not
check anything !!
If Your assembly code is in a OBJ file, be sure the procedures/functions
are of the same type (near or far) as declared in the pascal code.
Procedures/functions in a unit, that can be called from other units
(declared in the INTERFACE block) will allways be of the far type.

............................................................
Jan H. Hviid                            E-mail : j...@ddre.dk
Danish Defence Research Establishment
Ryvangs Alle 1,  P.O box 2715
DK - 2100 Copenhagen O.
Denmark
............................................................

Quote

> In article <01bb3f4c.4ba835c0$680132cc@clements> |\|\arauder wrote:

> >Hi all you programmer gods.  I am working on a program for a porgramming
> >competition and have came accross some wierd bug.  It runs the procedure
> >game fine but when it returns it automatically jumps half way through an
> >unrelated procedure.  I would appreciate your help.  If you have an idea
> >what i can do please e-mail me.  If you need the source than e-mail me to
> >cause it's kinda large.  Anyway thanks a bunch,

Other Threads