Your segments are a little large.  I would recommed that you create segments
< 50K each so you have room to add some code to those files without causing
too many link errors (16bit offset problems).

Secondly, if you turn on the option to generate a map file for your project,
you can see how big the segments really are after linkage.  Unused code will
be stripped out which is why your 71K segment (which is ostensibly too
large) appears to be working (by virtue of the fact that it downloads to the
device).

I would check this stuff out before continuing.

Thirdly, you must ensure that all startup code is in the first segment and
that you are using the MSL library (also in the first segment), making sure
you are using the library which matches your Int size setting.

Incidentally, I had a strange problem yesterday with a very mysterious
solution:  I had converted the Datebook application to be a true
multisegment app (removing all the far call stuff).  It was relatively easy
to remove all that.  I turned off the link single segment options and added
the MSL library as the first object in the first segment.  When I ran the
application it would crash during reset (though it would pass >300K gremlins
before that).  I was stumped.  I removed objects, rebuilt, checked all sorts
of other things.  Finally I tried to move the MSL library to be the last
object in segment 1.  All the sudden everything worked correctly and it no
longer crashed on reset.  HMM!  So I tried moving the MSL object up the
segment to see if there was some weird jump problem.  Nope, I moved it all
the way back to the first position and it still worked!  I don't know why
unless there was a bad object laying around.

Anyway, I hope this helps (sorry I had coffee today and I'm a bit
"writative").
Kevin

> -----Original Message-----
> From: Sudipta Ghose [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 27, 1999 11:12 AM
> To: [EMAIL PROTECTED]
> Subject: Dynamic heap corruption
> 
> 
> Hi all,
> 
> I have an app that has 3 code segments:
> 
> Segment 1: 71K
> Segment 2: 64K
> Segment 3: 62K
> 
> The application gives an error message in POSER
> "Dynamic heap chunk with header address 0x0000BDAA got 
> corrupted. The size 
> of the chunk (%chunk_size) was larger than the currently 
> accepted maximum 
> (%chunk_max)".
> 
> In the actual device it simply gives fatal exception. I 
> checked using the 
> debugger console, and it shows that heap 1 is corrupted - 
> "Invalid Handle 
> field". I was guessing since segment 1 is more than 64K, it 
> is causing the 
> error. However, reducing the size of segment 1 didn't help. 
> Is there any 
> limit on a code segment size? I found out after several tries 
> that the error 
> occurs while trying to allocate memory using MemHandleNew. 
> However if I hit 
> the debug button during the error, POSER displays a message 
> box saying 
> "Can't handle debug messages at this time." The only thing I 
> can do at that 
> time is to hit Ctl-Alt-Delete, and terminate both POSER and 
> CodeWarrior. Any 
> ideas what can cause such an error?
> 
> I am using:
> Codewarrior 5.0 (with update and patch)
> Windows 98 (with IE 5)
> POSER 2.1D29
> Palm III ROM/Palm 5000 ROM
> 
> Thanks for you help and patience.
> 
> -Sugho-
> 
> 
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
> 

Reply via email to