My app is crashing on device only not on simulator...

running beta 4. I can run forever in simulator, but on the actual device it crashes after a while. No clue why. Is there someone I can send my folder to zipped up and have you guys look at it? I wanted to launch this tonight but this crashing is an 11th hour glitch that put a stop to it, help appreciated, thanks! [import]uid: 6317 topic_id: 1134 reply_id: 301134[/import]

Hi,

if you want, send it to

mike (at) fantomgl (dot) com

I am still at work and will have time to look at it in around 10 hours.

Cheers
Michael Hartlef

http://www.whiteskygames.com
http://www.twitter.com/mhartlef [import]uid: 5712 topic_id: 1134 reply_id: 2908[/import]

I’m assuming this issue was picked up in this thread:

http://developer.anscamobile.com/forum/2010/06/08/crashing-too-many-listeners

…but let us know if this is a different problem!

In general, something that runs forever in the simulator but crashes after awhile on device is leaking memory, possibly by dynamically allocating a lot of objects and not fully deallocating them again.

The same code might also crash eventually on the simulator, but since you’ve got a whole Macintosh worth of memory there, it could take a LONG time. [import]uid: 3007 topic_id: 1134 reply_id: 3018[/import]

Hi Evan. Is there anything we can look at to see memory leaks? Xcode has an instrument for that but it’s not usable for Corona apps.

Thanks,
Tom [import]uid: 6119 topic_id: 1134 reply_id: 3042[/import]

Actually, you can use Instruments and Leaks to profile Corona applications:

  • First, do a device build and push it to the iPhone. Keep the iPhone connected via USB.

  • Launch Instruments from /Developer/Applications/Instruments.app

  • Click the “Leaks” instrument at launch

  • In the dropdown menu at the top left, select your connected device.

  • Then, from the same dropdown, select “Launch Executable > [name of your app]”

  • Then press the Record button. The app should launch on the iPhone and begin to return data to Instruments.

I’ve tested this method, and it seems to work well! This won’t do anything with purchased apps, since those don’t have any debugging hooks, but it works on your local device builds. [import]uid: 3007 topic_id: 1134 reply_id: 3057[/import]

I ran my app with these steps, and the only leak i saw was during facebook posting which uses the provided facebook plugin. Exact memory leak I got was

Leaked Object responsible Library Responsible Frame
NSURL CFNETWORK FilePathstorageNSCFString CFNETWORK FilePathstorage
It then locked up my device, not the same crash I was seeing, but just froze as soon as it checked for memory leaks so i’m assuming it was something new related to using “instruments”. [import]uid: 6317 topic_id: 1134 reply_id: 3063[/import]

You can send me your project and I’ll take a look. eric at anscamobile dot com. [import]uid: 54 topic_id: 1134 reply_id: 3065[/import]

ok for some reason my message got cut off

I also saw

NSCFString (same library and frame).

It then locked up my ipad, and the #leaks discovered gauge went crazy [import]uid: 6317 topic_id: 1134 reply_id: 3066[/import]

sent, thanks [import]uid: 6317 topic_id: 1134 reply_id: 3067[/import]

@evank

The Instruments/Leaks doesn’t work very well for me. I followed your steps to check a simple Corona program and I get “Target terminated too early to collect data.” The iPhone screen is blank and after 15 seconds the screen returns to the Springboard – indicating a crash. I did this with a few other simple Corona apps I created with the same results. I ran a couple of the Corona sample apps (Clock and Fishes) and they worked with the Instruments. All the apps work fine running by themselves on the iPhone 3GS.

Do you know what could be wrong?

Tom [import]uid: 6119 topic_id: 1134 reply_id: 3169[/import]

@evank

I need to modify my previous statement. I do have some apps that run under Instruments/Leaks but some don’t. They crash after launch.

Tom [import]uid: 6119 topic_id: 1134 reply_id: 3174[/import]

any luck on this? the facebook piece just suddenly stopped working in beta 5. it pops up with white web popup after they sign in. not sure where the second web popup comes from but it doesnt have any way to dismiss

[import]uid: 6317 topic_id: 1134 reply_id: 3237[/import]

We’re looking at it… [import]uid: 54 topic_id: 1134 reply_id: 3283[/import]