iPad 3, iOS 5, SDK 2.3.2 app crash on pan or zoom

3195
12
Jump to solution
10-03-2012 12:59 PM
AaronConnolly
Occasional Contributor
Hi,

I've identified potentially another issue with our application while running on iPad 3. The app crashes in a similar manner as when it crashes on iOS 6 and the iPhone 5. Unfortunately it is difficult to reproduce.

I can provide our project in its current state to reproduce the issue if you'd like.

The app throws a SIGSEGV on this thread on the iPad 3:

0 crime map 0x0046eb16 testflight_backtrace + 238
1 crime map 0x0046f800 TFSignalHandler + 264
2 libsystem_c.dylib 0x332557ec _sigtramp + 48
3 crime map 0x00127780 -[AGSEnvelope intersectsWithEnvelope:] + 144
4 crime map 0x001a64b2 -[AGSGraphicsLayerDrawingOperation main] + 2282
5 Foundation 0x37205392 -[__NSOperationInternal start] + 862
6 Foundation 0x3726e792 __block_global_6 + 102
7 libdispatch.dylib 0x34981c58 _dispatch_call_block_and_release + 12
8 libdispatch.dylib 0x34984816 _dispatch_worker_thread2 + 258
9 libsystem_c.dylib 0x33206dfa _pthread_wqthread + 294
10 libsystem_c.dylib 0x33206ccf start_wqthread + 7

Here's the other stack trace on iPhone for reference.

http://forums.arcgis.com/threads/67653-iPhone-5-and-iOS-6-and-SDK-2.3.2-app-crash-on-zoom-out

I've memory profiled my application and removed several of the possible memory leaks that it identifies. However for the memory leaks in 3rd party libraries I have left those alone because I'm not sure they're legitimate.

Any help or direction you could provide would be great.

Thanks,
- Aaron
0 Kudos
1 Solution

Accepted Solutions
NimeshJarecha
Esri Regular Contributor
Yes, moving to ARC might help. But if you keep your minimum target to 4.x then you'll still have to handle zeroing weak reference. Here is the apple doc.

Also, moving to ARC will be more performant. You are putting all local variables also into autorelease pool which is less performant.

//putting this into autorelease is less performant. it should be explicitly released.
AGSBingMapLayer* layer = [[[AGSBingMapLayer alloc] initWithAppID:kBingMapsAppID style:AGSBingMapLayerStyleAerialWithLabels] autorelease];

Regards,
Nimesh

View solution in original post

0 Kudos
12 Replies
AaronConnolly
Occasional Contributor
We were able to crash the app again. Here's a slightly different stack trace. This was reproduced by choosing an agency to zoom to, then moving the map before the points had loaded on the screen. Again this was a SIGSEGV.

0 crime map 0x003d3b16 testflight_backtrace + 238
1 crime map 0x003d4800 TFSignalHandler + 264
2 libsystem_c.dylib 0x332557ec _sigtramp + 48
3 CoreFoundation 0x37fa1e96 CFRetain + 82
4 CoreFoundation 0x37fabb7a +[__NSArrayI __new::] + 54
5 CoreFoundation 0x37faba94 -[__NSPlaceholderArray initWithObjects:count:] + 300
6 CoreFoundation 0x37fb339a -[NSArray initWithArray:range:copyItems:] + 762
7 CoreFoundation 0x37fb3096 -[NSArray initWithArray:copyItems:] + 62
8 libobjc.A.dylib 0x33387ed4 objc_setProperty_non_gc + 84
9 libobjc.A.dylib 0x3338f82e objc_setProperty + 18
10 crime map 0x0010b840 -[AGSGraphicsLayerDrawingOperation setGraphics:] + 76
11 crime map 0x000a078a -[AGSGraphicsLayer ags_drawGraphicsForParams:] + 486
12 crime map 0x000a059e -[AGSGraphicsLayer exportMapImage:] + 238
13 crime map 0x000f9d5c -[AGSDynamicLayerView draw:layerUpdateType:] + 2076
14 crime map 0x000f9f02 -[AGSDynamicLayerView mapZoomed:] + 34
15 crime map 0x000e2a74 -[AGSMapView kickOffMapZoomed:] + 328
16 CoreFoundation 0x37fb81fa -[NSObject performSelector:withObject:] + 42
17 Foundation 0x3727e746 __NSThreadPerformPerform + 350
18 CoreFoundation 0x3802dad2 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
19 CoreFoundation 0x3802d29e __CFRunLoopDoSources0 + 214
20 CoreFoundation 0x3802c044 __CFRunLoopRun + 652
21 CoreFoundation 0x37faf4a4 CFRunLoopRunSpecific + 300
22 CoreFoundation 0x37faf36c CFRunLoopRunInMode + 104
23 Foundation 0x371deb74 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 256
24 crime map 0x000dd2bc -[AGSWorkerThreadUnit workerThreadMainRoutine] + 252
25 Foundation 0x371eaa80 -[NSThread main] + 72
26 Foundation 0x3727e590 __NSThread__main__ + 1048
27 libsystem_c.dylib 0x3320c734 _pthread_start + 320
28 libsystem_c.dylib 0x3320c5ef thread_start + 7

We must be doing something wrong with our graphics layer?

- Aaron
0 Kudos
zhangbo
New Contributor
maybe ios5 and ios6 have something different?
0 Kudos
NimeshJarecha
Esri Regular Contributor
Aaron,

Could you please share your corrected (after removing all memory leaks) project so I can try it on iPad 3?

Regards,
Nimesh
0 Kudos
AaronConnolly
Occasional Contributor
Hi Nimesh,

The DropBox \Temp\CrimeMapping.zip archive has been updated. There are still a few "potential" memory leak issues with the ASIHttpRequest.m implementation but that is a library that I didn't not write and I am weary of messing with it. If you think there is a high probability of the crash originating from that library I'll go ahead and correct those build analyzer warnings. Otherwise I have taken care of all the other potential leaks in all of our app's view controllers and categories.

Let me know if you have trouble accessing the project from DropBox.

Thanks,
- Aaron
0 Kudos
NimeshJarecha
Esri Regular Contributor
I got the project. Thanks. I tried to reproduce crash on iPad3 but I'm not able to do so. Is it possible to post a video showing how to reproduce this crash?

Regards,
Nimesh
0 Kudos
AaronConnolly
Occasional Contributor
This is frustrating that we're the only ones able to repro the crash. It does happen somewhat randomly, though. Have you tried chosing an agency, then pinch zooming (in or out) on the map before the graphics layer refreshes?

I'll work on getting a video of the crash.

Thanks,
- Aaron
0 Kudos
NimeshJarecha
Esri Regular Contributor
I can understand your frustration but random crashes are like that only. I tried exactly same but still can't reproduce the crash.

Regards,
Nimesh
0 Kudos
AaronConnolly
Occasional Contributor
OK - sounds good. If we can produce a video of the crash I'll be sure to post it.

Could there be any project settings or configuration settings that I could look at tweaking? I'm pretty sure I've got everything working. What about the build targets? When looking at our project does everything look alright to you?

Thanks,
- Aaron
0 Kudos
NimeshJarecha
Esri Regular Contributor
I don't think there is anything in the project setting which cause the issue. However, you are seeing crash on iPad but your project is set only for iPhone. You'll probably have to do very little to make it a Universal app.

Regards,
Nimesh
0 Kudos