简体   繁体   中英

Flurry API crashing iPhone simulator

My app is crashing using iOS5 and iOS4.3 iPhone simulators in Xcode 4.2, the stack trace shows BAD_ACCESS signal in [FlurryAPI stopBackgroundTask] method.

While in the iOS4.3 simulator the app is only crashing when sending the app to background, in iOS5 is crashing always.I am attaching a picture of the debug navigator showing the thread where the BAD_ACCESS is happening.

On the other hand the app is working fine using a real device.

Any ideas of how can I get more information of what is going on and why this is happening?

在此输入图像描述

I've worked around this issue by adding the following to didFinishLaunchingWithOptions

#if TARGET_IPHONE_SIMULATOR
        [FlurryAnalytics setSessionReportsOnPauseEnabled:NO];
#endif

Flurry analytics does not run other than main Thread. It might crash on background thread.

It looks like you have a zombie - you have a situation where you're using code after you've released it. The retain count reaches zero, so the system dealloctes and re-uses the memory, then you make a change through the original reference. Now you have two different references to the same memory, each of which expects a different object to be there. In your case, one of the references is within flurry.

The reason for your device/simulator differences is the different memory allocation schemes the two architectures use - the simulator seems to re-use memory very aggressively.

Enable NSZombie and run in the debugger. If you're lucky, it will give you the object and the point it's used after deallocation.

Enable NSZombie: Menu 'Product', 'Edit Scheme...' 'Run' page, 'Diagnostics' tab, tick 'Enable Zombie Objects'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM