At 02:50 PM 11/3/2004, you wrote:
So I should never reallocate global variables in appstop?

What do you mean exactly by reallocating global variables? That seems like a very odd thing to do. I was referring to using something like a call to MemHeapFreeByOwnerID to free everything in your app.


The pointer that stores this linked list of destructors is called __global_destructor_chain. Tell the 68K Linker to generate a map file, and look at what variable is allocated in memory adjacent to it. I'd bet that you've got a buffer overrun. You can fetch the value of that global in your startup code and keep checking it to see when it changes in your program; since you're using POSE, you can even use the watchpoint support in the CW debugger to break when its value changes.

Since you say it's got the value 0xFE000000 in it, it really looks like you've written garbage into the pointer. It should either be NULL (0x00000000) or have a valid pointer in it.

I will retract one thing I said -- the global destructor chain isn't allocated on the heap -- all of the items in the chain are actually global variables.

-- Ben Combee, Technical Lead, Developer Services, PalmSource, Inc.
   "Combee on Palm OS" weblog: http://palmos.combee.net/
   Developer Fourm Archives:   http://news.palmos.com/read/all_forums/



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

Reply via email to