Hi Stanislav,

An example what could cause "Invalid chunk ptr":
MemPtrFree(  0x12345678 ) ;    // trying to free a non-alocated chunk

Usually the reasons are difficult to trace. It might be the use of a block
that was meanwhile deallocated and dozens of other reasons.

Use debug console, make the heap list and try to locate the reported pointer
in the list.
There are other methods for the tracing of allocation problems such as e.g.
overriding the memory functions.

> Also if the stack size is too small can you tell me how I can increase it?

Can't be done, I think.
While this will not explain your problems, it is always wise to keep the
stack usage low.

#pragma warn_stack_usage 100

Issues a compiler warning for all functions that need more than 100 By of
the stack.

Check all your code and collect functions that use too much stack.
Then debug and put a breakpoint into each of these functions.
This way you can check the call stack and decide which functions should be
handled. Use memory allocation to reduce the stack usage in these functions.

Best regards,
    Jan Slodicka


----- Original Message ----- 
From: "Stanislav Borisov" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[email protected]>
Sent: Thursday, August 11, 2005 5:01 PM
Subject: Simple question about how to increase stack size


> Hi all,
> I'm new in the forum and in the Palm programming.
>
> I'm developing Palm application with CW9.0 for PalmOne Treo 650 device and
now I'm testing with the simulator.
>
> I have following problem: Sometimes my application crashes with fatal
error "Invalid chunk ptr" or sometimes the simulator crashes comletely
without displaing this message. Without any changes in the code sometimes my
application works fine, and sometimes crashes.
>
> I read all posts related with this "Invalid chunk ptr" error and try lot
of things described there but nothing helps me.
>
> Please can somebody can explain me what can be the possible reasons for
such type of crashes?
>
> Also if the stack size is too small can you tell me how I can increase it?
>
> When I try to Debug application crashes in different places in the code
and I can't understand where exactly is the problem. I have checked all my
code for any memoty leaks but I didn't found anything wrong.
>
> My application has 3 segments, if this is significant.
>
> Please give me some advices, bocuse I'm stucked here. I will give you more
info about my app if you need.
>
> Thanks in advance!!!
>
> -- 
> For information on using the PalmSource Developer Forums, or to
unsubscribe, please see http://www.palmos.com/dev/support/forums/


-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to