I received the following crash report from a user.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xf0012e8d
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x3601cc98 objc_msgSend + 16
1 CoreFoundation 0x312bdc30 CFGetRetainCount
2 QuartzCore 0x30605c08 CA::release_root_if_unused(_CALayer*, _CALayer*, void*)
3 QuartzCore 0x30605bb4 x_hash_table_remove_if
4 QuartzCore 0x305e4f96 CA::Transaction::commit()
5 QuartzCore 0x305de04e CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*)
6 CoreFoundation 0x312fca2e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
7 CoreFoundation 0x312fe45e __CFRunLoopDoObservers
8 CoreFoundation 0x312ff754 __CFRunLoopRun
9 CoreFoundation 0x3128febc CFRunLoopRunSpecific
10 CoreFoundation 0x3128fdc4 CFRunLoopRunInMode
11 GraphicsServices 0x32478418 GSEventRunModal
12 GraphicsServices 0x324784c4 GSEventRun
13 UIKit 0x329f8d62 -[UIApplication _run]
14 UIKit 0x329f6800 UIApplicationMain
15 IW Select 0x00002b60 main + 44
16 IW Select 0x00002b28 start + 32
I'm having trouble debugging it since it doesn't look like the crash was even caused by something in my app. Does anyone know what could cause a crash like this?
If we observe the crash log, we will notice that, it was expecting some object but it was already released.(see it was calling CFGetRetainCount on the needed object to acertain that object is still alive, but it is not). Also, if we notice the frameworks then it indicates that crash could be because of some view is released or something related to it.(as it says its crashing during animation.)
0 libobjc.A.dylib 0x3601cc98 objc_msgSend + 16
1 CoreFoundation 0x312bdc30 CFGetRetainCount
2 QuartzCore 0x30605c08 CA::release_root_if_unused(_CALayer*, _CALayer*, void*)
3 QuartzCore 0x30605bb4 x_hash_table_remove_if
4 QuartzCore 0x305e4f96 CA::Transaction::commit()
5 QuartzCore 0x305de04e CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*)
6 CoreFoundation 0x312fca2e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
Thanks,
This might be able to help you out or at least get you started.
Debugging EXC_BAD_ACCESS Errors
Check your localization settings. Specifically, change your language settings to something other than English/your default language and see if you can reproduce the crash.
Related
The issue started happening randomly after iOS 16 update. For video exporting AVFoundation's AVAssetExportSession is used. The issue happens only when AVVideoComposition's animationTool property is applied. The ui freezes when the export process finishes. Main thread's call stack is attached below.
Thread 0 - com.apple.main-thread - (TH_STATE_WAITING)
0 libsystem_kernel.dylib +0x13004 _mach_msg2_internal
1 libsystem_kernel.dylib +0x13244 _mach_msg_overwrite
2 libsystem_kernel.dylib +0x1088 _mach_msg
3 QuartzCore +0x8a6ac CA::Render::Message::send_message()
4 QuartzCore +0x2612a8 CA::Render::Encoder::send_message(unsigned int, unsigned int, unsigned int*, unsigned long)
5 QuartzCore +0x31168 CA::Context::commit_transaction(CA::Transaction*, double, double*)
6 QuartzCore +0x663c0 CA::Transaction::commit()
7 UIKitCore +0x504fcc __UIApplicationFlushCATransaction
8 UIKitCore +0x651674 __UIUpdateSequenceRun
9 UIKitCore +0xc90900 _schedulerStepScheduledMainSection
10 UIKitCore +0xc8facc _runloopSourceCallback
11 CoreFoundation +0xd6228 ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
12 CoreFoundation +0xe2610 ___CFRunLoopDoSource0
13 CoreFoundation +0x66578 ___CFRunLoopDoSources0
14 CoreFoundation +0x7beb4 ___CFRunLoopRun
15 CoreFoundation +0x811e0 _CFRunLoopRunSpecific
16 GraphicsServices +0x1364 _GSEventRunModal
17 UIKitCore +0x3a2d84 -[UIApplication _run]
18 UIKitCore +0x3a29e8 _UIApplicationMain
19 PicsArt +0x4998b0 main (main.m:29:16)
20 dyld +0x15944 start
I tried to call AVAssetExportSession's exportAsynchronously and cancelExport functions on background queue, as a result the number of crashes decreased, but big number of users still get this app hang. I expect to find some workaround solution for this.
I don't have much information when did it happened, because it didn't happened on my watch.
Anyone understand what was the reason?
Crash Log:
OS Version: iPhone OS 5.0 (9A334)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x80624913
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x37c38fbc objc_msgSend + 16
1 UIKit 0x32bc8cec -[UIScrollView(UIScrollViewInternal) _scrollViewAnimationEnded] + 128
2 UIKit 0x0061d7ee -[UIScrollViewAccessibility(SafeCategory) _scrollViewAnimationEnded] + 358
3 CoreFoundation 0x309f8224 -[NSObject performSelector:withObject:] + 36
4 UIKit 0x32b84c2a -[UIAnimator stopAnimation:] + 606
5 UIKit 0x32b845d4 -[UIAnimator(Static) _advance:withTimestamp:] + 260
6 UIKit 0x32b844c6 -[UIAnimator(Static) _LCDHeartbeatCallback:] + 46
7 QuartzCore 0x3219a41c CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long) + 160
8 QuartzCore 0x3219a372 CA::Display::IOMFBDisplayLink::callback(__IOMobileFramebuffer*, unsigned long long, unsigned long long, unsigned long long, void*) + 54
9 IOMobileFramebuffer 0x3577ff8c IOMobileFramebufferVsyncNotifyFunc + 76
10 IOKit 0x31d2d88a IODispatchCalloutFromCFMessage + 182
11 CoreFoundation 0x30a62f3c __CFMachPortPerform + 356
12 CoreFoundation 0x30a6d54c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
13 CoreFoundation 0x30a6d4ee __CFRunLoopDoSource1 + 134
14 CoreFoundation 0x30a6c33c __CFRunLoopRun + 1364
15 CoreFoundation 0x309ef4d6 CFRunLoopRunSpecific + 294
16 CoreFoundation 0x309ef39e CFRunLoopRunInMode + 98
17 GraphicsServices 0x3361dfe6 GSEventRunModal + 150
18 UIKit 0x32a6173c UIApplicationMain + 1084
19 MyApp 0x00002304 0x1000 + 4868
20 MyApp 0x00002298 0x1000 + 4760
Looks like a segmentation fault. It seems like (just by observing the trace) there's some memory issue going on when the UIScrollView finishes a scroll animation. Have you tried enabling NSZombies or putting a breakpoint that catches any kind of exception? I know you said it didn't happen on your watch, but if you could get a brief description of where it happened, maybe you can attempt to replicate it while debugging it in Xcode.
Hullo,
I am experimenting a very vicious crash that shows up in the following way in the device logs:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x50000008
Crashed Thread: 0`
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x33b24c98 objc_msgSend + 16
1 Foundation 0x3429465a _NSURLConnectionReleaseClient + 30
2 CFNetwork 0x355ac608 ClientContextHolder<CFURLConnectionClient_V4>::forget() + 20
3 CFNetwork 0x355ac5ea URLConnectionClient::releaseClientLocked() + 34
4 CFNetwork 0x355a0e9a URLConnectionClient::processEvents() + 170
5 CFNetwork 0x355a0de2 URLConnection::multiplexerClientPerform(RunLoopMultiplexer*) + 30
6 CFNetwork 0x355a0d54 MultiplexerSource::perform() + 120
7 CFNetwork 0x355a0cd2 MultiplexerSource::_perform(void*) + 2
8 CoreFoundation 0x3039ca72 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 6
9 CoreFoundation 0x3039e758 __CFRunLoopDoSources0 + 376
10 CoreFoundation 0x3039f4e4 __CFRunLoopRun + 224
11 CoreFoundation 0x3032febc CFRunLoopRunSpecific + 224
12 CoreFoundation 0x3032fdc4 CFRunLoopRunInMode + 52
13 GraphicsServices 0x35571418 GSEventRunModal + 108
14 GraphicsServices 0x355714c4 GSEventRun + 56
15 UIKit 0x358c7d62 -[UIApplication _run] + 398
16 UIKit 0x358c5800 UIApplicationMain + 664
17 inArrivo 0x000023ca main (main.m:14)
18 inArrivo 0x00002394 start + 32
After having enabled NSZombie I also have a crash on the compiler log of the following form:
2011-05-09 16:12:24.400 inArrivo[5019:707] * -[NSURLConnection releaseDelegate]: message sent to deallocated instance 0x5d61670
appearing on the app main with the last NSLog comeing from a function with no url connections. Also if I remove some pieces of very innocent code from that function, no crash occurs, and the same happens when I run the complete application on the simulator.
Could someone give me some hints about what I may do to locate the piece of code producing the crash? Normal debugging of course is of little help here.
Thanks,
Fabrizio Bartolomucci
The message indicates that the delegate for NSURLConnection was deallocated. I would suggest you check the delegate object to see if you are doing an extra release on it.
I have problems analyzing my crashlog. The iPhone crashes sometimes, when I click on the app icon to start the app. The app is already "running" in background, but it's not active. This is the symbolized crash log:
Thread 0 Crashed:
0 libobjc.A.dylib 0x33479470 objc_msgSend + 28
1 CoreLocation 0x3436f68e -[CLLocationManager onClientEvent:supportInfo:] + 98
2 CoreLocation 0x3436f804 OnClientEvent + 16
3 CoreLocation 0x3436b522 CLClientInvokeCallback(__CLClient*, CLClientEvent, __CFDictionary const*) + 42
4 CoreLocation 0x3436cf74 CLClientHandleDaemonDataRegistration(__CLClient*, CLDaemonCommToClientRegistration const*, __CFDictionary const*) + 668
5 CoreLocation 0x3436d4c8 CLClientHandleDaemonData(__CFMessagePort*, long, __CFData const*, void*) + 212
6 CoreFoundation 0x33a813fe __CFMessagePortPerform + 242
7 CoreFoundation 0x33a556f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
8 CoreFoundation 0x33a556bc __CFRunLoopDoSource1 + 160
9 CoreFoundation 0x33a47f76 __CFRunLoopRun + 514
10 CoreFoundation 0x33a47c80 CFRunLoopRunSpecific + 224
11 CoreFoundation 0x33a47b88 CFRunLoopRunInMode + 52
12 GraphicsServices 0x33b0e4a4 GSEventRunModal + 108
13 GraphicsServices 0x33b0e550 GSEventRun + 56
14 UIKit 0x32099322 -[UIApplication _run] + 406
15 UIKit 0x32096e8c UIApplicationMain + 664
16 Norddeich 0x00002764 main (main.m:14)
17 Norddeich 0x00002718 start + 32
As far as i understand the stack trace, the error occurred in the main.m. Line 14 is part of the default code:
int retVal = UIApplicationMain(argc, argv, nil, nil);
Please give me a hint, how to find the error.
Thank you in advance!
Do you set it's delegate to nil before returning from controller (or at least in controller's dealloc)? I suspect CLLocationManager is trying to send a message to delegate which is deallocated already - that's why it crashes at obj_msgSend.
I had this same problem testing my app on 4.3, but not in 5.0. The issue was that I was trying to dealloc the CLLocationManager inside one of the delegate methods. It works fine in 5.0, but crashes a iPhone 3GS running 4.3 every time.
In the end I made the CLLocationManager object a property, then in the delegate method set the delegate to nil and dispatched a block to the main thread to release the object.
I am working on an app that tracks a users location. After about 20 minutes it seems that the app always crashes, and I am not sure why. Device logs show:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x069f6000
Crashed Thread: 0
Thread 0 Crashed:
0 Ride 0x00012e00 -[Route addCoordinate:] (Route.m:92)
1 Ride 0x0000877a -[MyRidesMapViewController locationManager:didUpdateToLocation:fromLocation:] (MyRidesMapViewController.m:528)
2 CoreLocation 0x0000931c -[CLLocationManager onClientEventLocation:] + 584
3 CoreLocation 0x00007552 -[CLLocationManager onClientEvent:supportInfo:] + 98
4 CoreLocation 0x000076a0 OnClientEvent + 16
5 CoreLocation 0x00002ade CLClientInvokeCallback(__CLClient*, CLClientEvent, __CFDictionary const*) + 42
6 CoreLocation 0x0000512c CLClientHandleDaemonDataLocation(__CLClient*, CLClientLocation const*, __CFDictionary const*) + 204
7 CoreLocation 0x0000528a CLClientHandleDaemonData(__CFMessagePort*, long, __CFData const*, void*) + 298
8 CoreFoundation 0x0006936a __CFMessagePortPerform + 242
9 CoreFoundation 0x00071aa4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
10 CoreFoundation 0x00073848 __CFRunLoopDoSource1 + 160
11 CoreFoundation 0x00074626 __CFRunLoopRun + 514
12 CoreFoundation 0x0001d8e4 CFRunLoopRunSpecific + 224
13 CoreFoundation 0x0001d7ec CFRunLoopRunInMode + 52
14 GraphicsServices 0x000036e8 GSEventRunModal + 108
15 GraphicsServices 0x00003794 GSEventRun + 56
16 UIKit 0x000062a0 -[UIApplication _run] + 396
17 UIKit 0x00004e10 UIApplicationMain + 664
18 Ride 0x00002a20 main (main.m:14)
19 Ride 0x000029d4 start + 32
Looks like I am trying to release something that has already been released, but what?! I have NSZombie enabled, and it does not seem to help.
It used to work, and I recently updated my class to use self. for anything that I synthesized, could this be the issue?
EDIT: I updated the error. It seems to be listing the line numbers for each line, but they do not seem to be helping to find the issue.
Do you have NSZombie enabled while you're running on the device? If so chances are you are running out of memory. As you know, NSZombie keeps released objects around so you can detect a double release.
Chances are you do have some memory issues though. Does the static analyzer show you anything? (shift-command-A).
Setting the location manager delegate to nil AND THEN releasing it fixed the crash for me.