From: <ko...@dh...> - 2004-01-20 23:47:45
|
I know why it crashes on exit. It's always because you've overwritten an = array bound. Either the OS does something when switching to another program (cl= eaning up mem or something I guess), or you are overwritting the stack position = that holds where to return to after the program exits. The different behaviour on different hardware is because the OSes are all tweaked. The way I see it is if there is a crash on any of them, there is= a potential crash on all of them. Look for places you interact with allocated memory. Add if(pointer) in fr= ont of every statement using mem. Look over your code with a fine toothcomb, or = chunk it up and run sections separtely to look for places you might be going ou= t of bounds. I hit this problem a while ago. Threw a wrench in my gears for two good w= eeks. Hope it helps you get the VFS thing working :D -Nick Original Message: As this is a general question, I do not expect anything but a general answer. That said: does anyone know why a program might work fine on an i705 (OS 4.x) and the Palm Simulator (OS 5.1), but crash on exit on a Sony Clie (OS 5.1), Zire 21 (OS 5.2), Zire Simulator and the new OS 5.4 Simulator, along with the Emulator for 3.5 and 4.1 ROMs? Basically, the program allocates Char ** blocks using MemPtrNew (the code example comes from OnBoardC_Main.c) and frees it all with MemPtrFree. I can walk the program through the debugger through to the very end and not receive an error, but as soon as the "return 0;" at the end of the program executes, all of the above die (except for the i705 and Palm Sim 5.1). So, my general question is: what _kinds_ of things could I be missing? The code in question is the prototype of the Add To Project form with VFS support added, wrapped as an application. I figure that there is something I missed (obviously -- after all it crashes!), but it is totally baffling. I open no databases, do not get or save preferences. I do walk the databases and look at the database info, but otherwise I allocate said memory, attach them to lists, and free said memory. Hoping for pointers (bad pun intended). Dale ------------------------------------------------ This mail sent from DHBiT - http://mail.dhbit.ca Come get your free, secure 5MB mailbox today! |