October 30, 2025, 12:59:26 AM

News:

IWBasic runs in Windows 11!


First chance exception: Address 0x0044295D Access Violation

Started by JoaoAfonso, June 16, 2008, 01:29:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JoaoAfonso

I am getting crazy. A program that used to run ok as supposed, suddenly started giving this error in debug mode. I know I made some small changes, but even fixing it, still gives this error.
When not in debug mode, the program closes itself without being supposed to, and also without any other error message. Is this something obvious?
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900

Ionic Wind Support Team

Ionic Wind Support Team

JoaoAfonso

I've remembered sometime ago something that did the same. The solution was increasing stack size and stack commit size. Did it now and worked...

I also remember of discuss this here already. It is not too much worrying have big stack sizes, right? Anyway, there is a way to round it? In 15 days I might forget this, and in 30 days another program breaks due to this... :/
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900

Ionic Wind Support Team

The compiler will warn you if it detects a subroutine exceeding stack size at compile time.  But it can't predict overall stack usage for things like reentrant subroutines, recursion, etc.  Your total stack usage is the size of the local variables in the current execution path.

So if Foo() calls Foo2() which calls Foo3()  then stack usage when Foo3 is running is the total of the local variables defined in all three subroutines. 

The easiest way around it is to change your coding habits.  Don't define mammoth arrays in subroutines. use NEW and DELETE instead and pass a pointer around if you need to.

Paul.
Ionic Wind Support Team

JoaoAfonso

I guess that slowly I can do it. I learn and use, lets say, at least 1 great trick per month in these foruns :) thank you
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900