My app is ARC abide app but still I see multiple crashes with message "Attempted to de-reference garbage pointer" in the crash report. They are hard to diagnose.
My question is why application is crashing because of memory issues even after we are on ARC and we are not able to reproduce it with same steps. How to tackle such crashes?
One such crash report is as below:
CrashReporterKey: 896d0c8676c0e02eb292865a654825359de4d427
HardwareModel: iPod4,1 Version: 5510 (3.0.0) OSVersion: iPhone OS
6.1.3 (10B329) Date/Time: 2013-08-15 09:50:51.000 -0700 FirmwareVersion: 2.27.0 Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes:
KERN_INVALID_ADDRESS at 0x31fd4078 Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0
Crashed: 0 libobjc.A.dylib 0x3b1ac5b0 objc_msgSend +
16 1 UIKit 0x3533c350 0x35338000 + 17232 2
UIKit 0x3533b6c8 0x35338000 + 14024 3
UIKit 0x3533b118 0x35338000 + 12568 4
GraphicsServices 0x3702d5a0 0x37027000 + 26016 5
GraphicsServices 0x3702d1d0 0x37027000 + 25040 6
CoreFoundation 0x33508170 0x33471000 + 618864 7
CoreFoundation 0x33508110 0x33471000 + 618768 8
CoreFoundation 0x33506f98 0x33471000 + 614296 9
CoreFoundation 0x33479eb8 CFRunLoopRunSpecific + 352
10 CoreFoundation 0x33479d48 CFRunLoopRunInMode +
104 11 GraphicsServices 0x3702c2e8 GSEventRunModal +
72 12 UIKit 0x3538f300 UIApplicationMain +
1120 13 MyApp 0x000a8e58 main + 20
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager Thread
1: 0 libsystem_kernel.dylib 0x3b69f648 kevent64 + 24 1
libdispatch.dylib 0x3b5cadf8 0x3b5c7000 + 15864
Thread 2 name: WebThread Thread 2: 0 WebCore
0x39503560 0x3945d000 + 681312 1 WebCore
0x394e7f90 0x3945d000 + 569232 2 WebCore
0x394e2788 0x3945d000 + 546696 3 WebCore
0x396ca8a8 _ZN7WebCore11FrameLoader16detachFromParentEv + 64 4
WebKit 0x39e12618 0x39d8d000 + 546328 5
WebCore 0x394699c8 0x3945d000 + 51656 6
WebKit 0x39e12490 0x39d8d000 + 545936 7
WebKit 0x39e18570 0x39d8d000 + 570736 8
WebKit 0x39e184a8 0x39d8d000 + 570536 9
WebCore 0x394fb850 0x3945d000 + 649296 10
CoreFoundation 0x33508680 0x33471000 + 620160 11
CoreFoundation 0x33507ee8 0x33471000 + 618216 12
CoreFoundation 0x33506cb0 0x33471000 + 613552 13
CoreFoundation 0x33479eb8 CFRunLoopRunSpecific + 352
14 CoreFoundation 0x33479d48 CFRunLoopRunInMode +
104 15 WebCore 0x39467500 0x3945d000 + 42240
16 libsystem_c.dylib 0x3b608310 0x3b5f7000 + 70416
Thread 3 name: CommRunLoop Thread Thread 3: 0
libsystem_kernel.dylib 0x3b6af6a4 __semwait_signal + 24 1
Foundation 0x33decc60 0x33d99000 + 343136 2
MyApp 0x002be680 -[CommRunLoop
runLoopThread:] + 504 3 Foundation 0x33e49e80
0x33d99000 + 724608 4 libsystem_c.dylib 0x3b608310
0x3b5f7000 + 70416
Thread 4 name: com.apple.CFSocket.private Thread 4: 0
libsystem_kernel.dylib 0x3b6af594 select$DARWIN_EXTSN + 20 1
libsystem_c.dylib 0x3b608310 0x3b5f7000 + 70416
Thread 5: 0 libsystem_kernel.dylib 0x3b6af6a4
__semwait_signal + 24 1 Foundation 0x33decc60 0x33d99000 + 343136 2 MyApp 0x00333580
-[KSCrashDeadlockMonitor runMonitor] + 244 3 Foundation 0x33e49e80 0x33d99000 + 724608 4 libsystem_c.dylib
0x3b608310 0x3b5f7000 + 70416
Thread 6 name: KSCrash Exception Handler (Secondary) Thread 6: 0
libsystem_kernel.dylib 0x3b69eeb4 mach_msg_trap + 20 1
MyApp 0x0032f710 ksmachexc_i_handleExceptions
+ 124 2 libsystem_c.dylib 0x3b608310 0x3b5f7000 + 70416
Thread 7 name: KSCrash Exception Handler (Primary) Thread 7:
Thread 8 name: com.apple.NSURLConnectionLoader Thread 8: 0
libsystem_kernel.dylib 0x3b69eeb4 mach_msg_trap + 20 1
CoreFoundation 0x33508040 0x33471000 + 618560 2
CoreFoundation 0x33506da0 0x33471000 + 613792 3
CoreFoundation 0x33479eb8 CFRunLoopRunSpecific + 352
4 CoreFoundation 0x33479d48 CFRunLoopRunInMode +
104 5 Foundation 0x33dc63d0 0x33d99000 + 185296
6 Foundation 0x33e49e80 0x33d99000 + 724608 7
libsystem_c.dylib 0x3b608310 0x3b5f7000 + 70416
Thread 9 name: JavaScriptCore::BlockFree Thread 9: 0
libsystem_kernel.dylib 0x3b6af08c __psynch_cvwait + 24 1
libsystem_c.dylib 0x3b600aa0 pthread_cond_timedwait + 40
2 JavaScriptCore 0x37422c70
_ZN3WTF15ThreadCondition9timedWaitERNS_5MutexEd + 104 3 JavaScriptCore 0x37534550 0x373c7000 + 1496400 4
JavaScriptCore 0x37546fa8 0x373c7000 + 1572776 5
libsystem_c.dylib 0x3b608310 0x3b5f7000 + 70416
Thread 10 name: Dispatch queue: com.apple.root.background-priority
Thread 10: 0 MyApp 0x00320a18
+[KSCrashReportFilterAppleFmt filterWithReportStyle:] + 0 1 libdispatch.dylib 0x3b5c9118 0x3b5c7000 + 8472 2
libdispatch.dylib 0x3b5d7258 0x3b5c7000 + 66136 3
libdispatch.dylib 0x3b5d73b8 0x3b5c7000 + 66488 4
libsystem_c.dylib 0x3b5fda10 0x3b5f7000 + 27152
Thread 11: 0 libsystem_kernel.dylib 0x3b6afd98
__workq_kernreturn + 8 1 libsystem_c.dylib 0x3b5fda10 0x3b5f7000 + 27152
Thread 12: 0 libsystem_kernel.dylib 0x3b6afd98
__workq_kernreturn + 8 1 libsystem_c.dylib 0x3b5fda10 0x3b5f7000 + 27152
Thread 13: 0 libsystem_kernel.dylib 0x3b6afd98
__workq_kernreturn + 8 1 libsystem_c.dylib 0x3b5fda10 0x3b5f7000 + 27152
Thread 0 crashed with ARM Thread State:
r0: 0x1fd2a130 r1: 0x357e82c0 r2: 0x1fd3a6d0 r3: 0x20a8a4a0
r4: 0x31fd4070 r5: 0x20a8a4a0 r6: 0x2fd59a10 r7: 0x2fd599f8
r8: 0x20a8af20 r9: 0x0d5fa0b0 r10: 0xbecb6c00 r11: 0x1fd3a6d0
ip: 0x3bb2bd64 sp: 0x2fd599c8 lr: 0x355abb97 pc: 0x3b1ac5b0 cpsr: 0x20000030
Extra Information:
Stack Dump (0x2fd599a0-0x2fd59a18):
A8B4BC3B209FF240B499D52FADD81A3BA8B4BC3BC099D52F45D91A3BD0A6D31FC899D52FF1D01B3BA0A4A820D0A6D31F000000000020B23F00000000806DD9BF00000000E073ECBF0000000000000000009F63BF209FF240789AD52F51C3333500000000806DD9BF00000000E073ECBFDA1B7C21209FF240
Notable Addresses: {
"r1": {
"address": 897483456,
"type": "string",
"value": "accelerometer:didAccelerate:"
},
"r11": {
"address": 533964496,
"class": "UIAccelerometer",
"ivars": {
"_delegate": {
"address": 533897520,
"type": "unknown"
},
"_updateInterval": 0.1
},
"type": "objc_object"
},
"r2": {
"address": 533964496,
"class": "UIAccelerometer",
"ivars": {
"_delegate": {
"address": 533897520,
"type": "unknown"
},
"_updateInterval": 0.1
},
"type": "objc_object"
},
"r3": {
"address": 547923104,
"class": "UIAcceleration",
"ivars": {
"timestamp": 76274,
"x": 0.0708008,
"y": -0.397308,
"z": -0.889145
},
"type": "objc_object"
},
"r5": {
"address": 547923104,
"class": "UIAcceleration",
"ivars": {
"timestamp": 76274,
"x": 0.0708008,
"y": -0.397308,
"z": -0.889145
},
"type": "objc_object"
},
"r8": {
"address": 547925792,
"class": "__NSCFType",
"ivars": {},
"type": "objc_object"
},
"stack#0x2fd599a0": {
"address": 1002222760,
"class": "UIAcceleration",
"type": "objc_class"
},
"stack#0x2fd599b0": {
"address": 1002222760,
"class": "UIAcceleration",
"type": "objc_class"
},
"stack#0x2fd599bc": {
"address": 533964496,
"class": "UIAccelerometer",
"ivars": {
"_delegate": {
"address": 533897520,
"type": "unknown"
},
"_updateInterval": 0.1
},
"type": "objc_object"
},
"stack#0x2fd599c8": {
"address": 547923104,
"class": "UIAcceleration",
"ivars": {
"timestamp": 76274,
"x": 0.0708008,
"y": -0.397308,
"z": -0.889145
},
"type": "objc_object"
},
"stack#0x2fd599cc": {
"address": 533964496,
"class": "UIAccelerometer",
"ivars": {
"_delegate": {
"address": 533897520,
"type": "unknown"
},
"_updateInterval": 0.1
},
"type": "objc_object"
} }
CrashDoctor Diagnosis: Attempted to dereference garbage pointer
0x31fd4078.
It's still possible to write buggy code, even when you're using ARC--it's not magic, and there are still rules. In this instance, try running a debug build of your app in Xcode with "NSZombies" turned on. What this does, is every time your app attempts to deallocate an object, Objective-C instead replaces it with an NSZombie object that will provide a much more helpful error message when you attempt to use it (attempting to dereference a garbage pointer, as your silly CrashDoctor thing is telling you).
Related
In Swift 4, on Xcode Version 9.3.1 (9E501), I am utilizing DispatchQueue.global(qos: .background).async {...} to run a while(true) loop in the background:
func appStartDispatchQueue() {
DispatchQueue.global(qos: .background).async {
while(true) {
let networkStatus = Verification.onCompanyNetwork()
DispatchQueue.main.async {
self.onNetwork = networkStatus
}
sleep(3)
}
}
}
Verification.onCompanyNetwork() is running a ping via bash script to see if there is response from a server on a corporate network.
I need this thread running in the background at all times for this application - so even if it fails, how can I catch the exception and make sure the thread starts up again? Right now I'm not even sure why the thread is failing...
Two discovered crash scenarios so far:
while running app (outside of Xcode), the app crashes on average after 3-6 hours of continuous running
while running app (inside of Xcode), the app does NOT crash, even after 3-6 hours of continuous running
The entire error message is found below:
Crashed Thread: 1 Dispatch queue: com.apple.root.background-qos
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to set posix_spawn_file_actions for fd -1 at index 0 with errno 9'
terminating with uncaught exception of type NSException
abort() called
Application Specific Backtrace 1:
0 CoreFoundation 0x00007fff339d9ecd __exceptionPreprocess + 256
1 libobjc.A.dylib 0x00007fff5fa91720 objc_exception_throw + 48
2 CoreFoundation 0x00007fff339d9cff +[NSException raise:format:] + 201
3 Foundation 0x00007fff35ccf581 -[NSConcreteTask launchWithDictionary:error:] + 3236
4 AdminAccess 0x000000010f268b32 _T011AdminAccess9ScriptingC12shellCommandSSSgSS0D4Path_SaySSG9argumentstFZ + 370
5 AdminAccess 0x000000010f266e20 _T011AdminAccess9ScriptingC13runBashScriptS2S10scriptName_SS3argtFZ + 32496
6 AdminAccess 0x000000010f25779b _T011AdminAccess12VerificationC16onCompanyNetworkSbyFZ + 107
7 AdminAccess 0x000000010f26a834 _T011AdminAccess11AppDelegateC21appStartDispatchQueueyyFyycfU_ + 36
8 AdminAccess 0x000000010f26a99d _T011AdminAccess11AppDelegateC21appStartDispatchQueueyyFyycfU_TA + 13
9 AdminAccess 0x000000010f26aa1d _T0Ieg_IeyB_TR + 45
10 libdispatch.dylib 0x00007fff60b10d53 _dispatch_call_block_and_release + 12
11 libdispatch.dylib 0x00007fff60b11dcf _dispatch_client_callout + 8
12 libdispatch.dylib 0x00007fff60b1fe80 _dispatch_root_queue_drain + 671
13 libdispatch.dylib 0x00007fff60b204bd _dispatch_worker_thread2 + 90
14 libsystem_pthread.dylib 0x00007fff60d526dd _pthread_wqthread + 619
15 libsystem_pthread.dylib 0x00007fff60d52405 start_wqthread + 13
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff60c9917a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff60c996d0 mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff339230c2 __CFRunLoopServiceMachPort + 337
3 com.apple.CoreFoundation 0x00007fff33922611 __CFRunLoopRun + 1654
4 com.apple.CoreFoundation 0x00007fff33921d48 CFRunLoopRunSpecific + 463
5 com.apple.HIToolbox 0x00007fff32bb8ab5 RunCurrentEventLoopInMode + 293
6 com.apple.HIToolbox 0x00007fff32bb87eb ReceiveNextEventCommon + 618
7 com.apple.HIToolbox 0x00007fff32bb8568 _BlockUntilNextEventMatchingListInModeWithFilter + 64
8 com.apple.AppKit 0x00007fff30e73363 _DPSNextEvent + 997
9 com.apple.AppKit 0x00007fff30e72102 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1362
10 com.apple.AppKit 0x00007fff30e6c165 -[NSApplication run] + 699
11 com.apple.AppKit 0x00007fff30e5b8a3 NSApplicationMain + 780
12 mace.AdminAccess 0x000000010f26be6d main + 13 (AppDelegate.swift:18)
13 libdyld.dylib 0x00007fff60b5fed9 start + 1
Thread 1 Crashed:: Dispatch queue: com.apple.root.background-qos
0 libsystem_kernel.dylib 0x00007fff60c9f23e __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff60d55c1c pthread_kill + 285
2 libsystem_c.dylib 0x00007fff60c081c9 abort + 127
3 libc++abi.dylib 0x00007fff5e289231 abort_message + 231
4 libc++abi.dylib 0x00007fff5e2893cd default_terminate_handler() + 265
5 libobjc.A.dylib 0x00007fff5fa93c87 _objc_terminate() + 97
6 libc++abi.dylib 0x00007fff5e294dfe std::__terminate(void (*)()) + 8
7 libc++abi.dylib 0x00007fff5e294e73 std::terminate() + 51
8 libdispatch.dylib 0x00007fff60b11de3 _dispatch_client_callout + 28
9 libdispatch.dylib 0x00007fff60b1fe80 _dispatch_root_queue_drain + 671
10 libdispatch.dylib 0x00007fff60b204bd _dispatch_worker_thread2 + 90
11 libsystem_pthread.dylib 0x00007fff60d526dd _pthread_wqthread + 619
12 libsystem_pthread.dylib 0x00007fff60d52405 start_wqthread + 13
Thread 2:: com.apple.NSEventThread
0 libsystem_kernel.dylib 0x00007fff60c9917a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff60c996d0 mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff339230c2 __CFRunLoopServiceMachPort + 337
3 com.apple.CoreFoundation 0x00007fff33922611 __CFRunLoopRun + 1654
4 com.apple.CoreFoundation 0x00007fff33921d48 CFRunLoopRunSpecific + 463
5 com.apple.AppKit 0x00007fff30e7bf89 _NSEventThread + 160
6 libsystem_pthread.dylib 0x00007fff60d53305 _pthread_body + 126
7 libsystem_pthread.dylib 0x00007fff60d5626f _pthread_start + 70
8 libsystem_pthread.dylib 0x00007fff60d52415 thread_start + 13
Thread 3:
0 libsystem_pthread.dylib 0x00007fff60d523f8 start_wqthread + 0
1 ??? 0x0000000054485244 0 + 1414025796
Thread 4:
0 libsystem_pthread.dylib 0x00007fff60d523f8 start_wqthread + 0
1 ??? 0x0000000000000903 0 + 2307
Thread 1 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x00007000054b9000 rcx: 0x00007000054b88b8 rdx: 0x0000000000000000
rdi: 0x0000000000002703 rsi: 0x0000000000000006 rbp: 0x00007000054b88f0 rsp: 0x00007000054b88b8
r8: 0x00007000054b8778 r9: 0x00007000054b8950 r10: 0x0000000000000000 r11: 0x0000000000000206
r12: 0x0000000000002703 r13: 0x0000003000000008 r14: 0x0000000000000006 r15: 0x000000000000002d
rip: 0x00007fff60c9f23e rfl: 0x0000000000000206 cr2: 0x00007fff93949188
The best Way to do that is using https://github.com/ashleymills/Reachability.swift
in this link you'll see how the ask for google.com server all the time.
https://github.com/ashleymills/Reachability.swift/blob/master/ReachabilitySample/ViewController.swift
there are many ways to do it
let hostReachability = Reachability(hostName:"www.apple.com")
hostReachability.startNotifier()
NSNotificationCenter.defaultCenter().addObserver(
self,
selector: "reachabilityChanged:",
name: kReachabilityChangedNotification,
object: nil)
it will avoid you to use while(true) or stuff like that is hard to handle with.
enum NetworkStatus {
case notReachable, reachableViaWiFi, reachableViaWWAN
}
var currentReachabilityStatus: NetworkStatus
I got crash if application is not in background state and then click on notification. There is no memory leak and set architectures standard (armv6,armv7,armv7s).also referred link
Springboard crash when app is restored from push notification from GameCenter
Any suggestion to find out solution.Thanks in Advance.
Device Log as below:
OS Version: iOS 6.1.3 (10B329)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000024
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libdispatch.dylib 0x3936b332 0x3936a000 + 4914
1 CropAndGuess 0x000a92c0 0xa1000 + 33472
2 CropAndGuess 0x000a6252 0xa1000 + 21074
3 CropAndGuess 0x000a551a 0xa1000 + 17690
4 UIKit 0x3313ead4 0x330db000 + 408276
5 UIKit 0x3313e65e 0x330db000 + 407134
6 UIKit 0x33136846 0x330db000 + 374854
7 UIKit 0x330dec34 0x330db000 + 15412
8 UIKit 0x330de6c8 0x330db000 + 14024
9 UIKit 0x330de116 0x330db000 + 12566
10 GraphicsServices 0x34dd05a0 0x34dca000 + 26016
11 CoreFoundation 0x312ab680 0x31214000 + 620160
12 CoreFoundation 0x312aaee4 0x31214000 + 618212
13 CoreFoundation 0x312a9cb2 0x31214000 + 613554
14 CoreFoundation 0x3121ceb8 0x31214000 + 36536
15 CoreFoundation 0x3121cd44 0x31214000 + 36164
16 UIKit 0x33135480 0x330db000 + 369792
17 UIKit 0x331322fc 0x330db000 + 357116
18 CropAndGuess 0x000a3bbc 0xa1000 + 11196
19 CropAndGuess 0x000a3b54 0xa1000 + 11092
Thread 1:
0 libsystem_kernel.dylib 0x39452d98 0x39441000 + 73112
1 libsystem_c.dylib 0x393a0cf6 0x3939a000 + 27894
2 libsystem_c.dylib 0x393a0a12 0x3939a000 + 27154
3 libsystem_c.dylib 0x393a08a0 0x3939a000 + 26784
Thread 2 name: Dispatch queue: com.apple.libdispatch-manager
Thread 2:
0 libsystem_kernel.dylib 0x39442648 0x39441000 + 5704
1 libdispatch.dylib 0x3937b4ec 0x3936a000 + 70892
2 libdispatch.dylib 0x3936ddf4 0x3936a000 + 15860
Thread 3:
0 libsystem_kernel.dylib 0x39452d98 0x39441000 + 73112
1 libsystem_c.dylib 0x393a0cf6 0x3939a000 + 27894
2 libsystem_c.dylib 0x393a0a12 0x3939a000 + 27154
3 libsystem_c.dylib 0x393a08a0 0x3939a000 + 26784
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x39441eb4 0x39441000 + 3764
1 libsystem_kernel.dylib 0x39442048 0x39441000 + 4168
2 CoreFoundation 0x312ab040 0x31214000 + 618560
3 CoreFoundation 0x312a9d9e 0x31214000 + 613790
4 CoreFoundation 0x3121ceb8 0x31214000 + 36536
5 CoreFoundation 0x3121cd44 0x31214000 + 36164
6 WebCore 0x3720a500 0x37200000 + 42240
7 libsystem_c.dylib 0x393ab30e 0x3939a000 + 70414
8 libsystem_c.dylib 0x393ab1d4 0x3939a000 + 70100
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x1fdaab50 r2: 0x3936c115 r3: 0x1fdaab50
r4: 0x3aefd06c r5: 0x0015a854 r6: 0x00153828 r7: 0x2fd5e4e8
r8: 0x00000001 r9: 0x0000007f r10: 0x38f4f5a1 r11: 0x001538d4
ip: 0x3aefe7f4 sp: 0x2fd5e4b4 lr: 0x000a92c5 pc: 0x3936b332
cpsr: 0x20000030
I'm using web services and location service in my application. My app is working fine on other devices but crashing on iPhone 4s. This problem has occurred after updating my XCode to XCode5. The Crash logs are as follows:
Date/Time: 2013-10-13 00:34:29.988 +1000
OS Version: iOS 7.0.2 (11A501)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
(0x2d849f4e 0x37c226aa 0x2d849c64 0x2ea11b24 0x6344a 0x2ffbf5fe 0x3006a8fc 0x3006a812 0x30069dee 0x30069b18 0x30069888 0x30069820 0x2ffbb01e 0x2fc44246 0x2fc3fa56 0x2fc3f8e8 0x2fc3f2fa 0x2fc3f10a 0x2ffb333e 0x2d8151d0 0x2d812b74 0x2d812eb6 0x2d77dce2 0x2d77dac6 0x3249e27e 0x3001fa3c 0x5eb0e 0x3812aab2)
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x381e11fc 0x381ce000 + 78332
1 libsystem_pthread.dylib 0x3824aa2e 0x38247000 + 14894
2 libsystem_c.dylib 0x38191ff8 0x38148000 + 303096
3 libc++abi.dylib 0x374c0cd2 0x374c0000 + 3282
4 libc++abi.dylib 0x374d96e0 0x374c0000 + 104160
5 libobjc.A.dylib 0x37c2291e 0x37c1a000 + 35102
6 libc++abi.dylib 0x374d71c4 0x374c0000 + 94660
7 libc++abi.dylib 0x374d6d28 0x374c0000 + 93480
8 libobjc.A.dylib 0x37c227f2 0x37c1a000 + 34802
9 CoreFoundation 0x2d77dd58 0x2d776000 + 32088
10 CoreFoundation 0x2d77dac6 0x2d776000 + 31430
11 GraphicsServices 0x3249e27e 0x32496000 + 33406
12 UIKit 0x3001fa3c 0x2ffb0000 + 457276
13 CashBackApp 0x0005eb0e 0x59000 + 23310
14 libdyld.dylib 0x3812aab4 0x38129000 + 6836
Thread 1:
0 libsystem_kernel.dylib 0x381ce83c 0x381ce000 + 2108
1 libdispatch.dylib 0x3810f220 0x38104000 + 45600
2 libdispatch.dylib 0x3810efa6 0x38104000 + 44966
Thread 2:
0 libsystem_kernel.dylib 0x381ceaf4 0x381ce000 + 2804
1 libdispatch.dylib 0x3810d428 0x38104000 + 37928
2 CoreLocation 0x2dd00c88 0x2dcfe000 + 11400
3 CoreLocation 0x2dd0564a 0x2dcfe000 + 30282
4 CoreLocation 0x2dd31ba8 0x2dcfe000 + 211880
5 libxpc.dylib 0x382573aa 0x38253000 + 17322
6 libxpc.dylib 0x3825593e 0x38253000 + 10558
7 libdispatch.dylib 0x3810fd42 0x38104000 + 48450
8 libdispatch.dylib 0x3810c256 0x38104000 + 33366
9 libdispatch.dylib 0x3810ff8c 0x38104000 + 49036
10 libdispatch.dylib 0x3810c256 0x38104000 + 33366
11 libdispatch.dylib 0x3810c096 0x38104000 + 32918
12 libdispatch.dylib 0x3810c256 0x38104000 + 33366
13 libdispatch.dylib 0x3810c096 0x38104000 + 32918
14 libdispatch.dylib 0x3810cd12 0x38104000 + 36114
15 libdispatch.dylib 0x3810cf88 0x38104000 + 36744
16 libsystem_pthread.dylib 0x38247dbc 0x38247000 + 3516
17 libsystem_pthread.dylib 0x38247c80 0x38247000 + 3200
Thread 3:
0 libsystem_kernel.dylib 0x381e1c7c 0x381ce000 + 81020
1 libsystem_pthread.dylib 0x38247dc6 0x38247000 + 3526
2 libsystem_pthread.dylib 0x38247c80 0x38247000 + 3200
Thread 4 name: com.apple.NSURLConnectionLoader
Thread 4:
0 libsystem_kernel.dylib 0x381cea8c 0x381ce000 + 2700
1 libsystem_kernel.dylib 0x381ce888 0x381ce000 + 2184
2 CoreFoundation 0x2d8147c6 0x2d776000 + 649158
3 CoreFoundation 0x2d812eec 0x2d776000 + 642796
4 CoreFoundation 0x2d77dce2 0x2d776000 + 31970
5 CoreFoundation 0x2d77dac6 0x2d776000 + 31430
6 Foundation 0x2e1b7492 0x2e15f000 + 361618
7 Foundation 0x2e22ce22 0x2e15f000 + 843298
8 libsystem_pthread.dylib 0x38249c1a 0x38247000 + 11290
9 libsystem_pthread.dylib 0x38249b8a 0x38247000 + 11146
10 libsystem_pthread.dylib 0x38247c8c 0x38247000 + 3212
Thread 5:
0 libsystem_kernel.dylib 0x381e1c7c 0x381ce000 + 81020
1 libsystem_pthread.dylib 0x38247dc6 0x38247000 + 3526
2 libsystem_pthread.dylib 0x38247c80 0x38247000 + 3200
Thread 6:
0 libsystem_kernel.dylib 0x381e1c7c 0x381ce000 + 81020
1 libsystem_pthread.dylib 0x38247dc6 0x38247000 + 3526
2 libsystem_pthread.dylib 0x38247c80 0x38247000 + 3200
Thread 7 name: com.apple.CFSocket.private
Thread 7:
0 libsystem_kernel.dylib 0x381e1440 0x381ce000 + 78912
1 CoreFoundation 0x2d818688 0x2d776000 + 665224
2 libsystem_pthread.dylib 0x38249c1a 0x38247000 + 11290
3 libsystem_pthread.dylib 0x38249b8a 0x38247000 + 11146
4 libsystem_pthread.dylib 0x38247c8c 0x38247000 + 3212
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x00002060
r4: 0x00000006 r5: 0x3a05918c r6: 0x00000000 r7: 0x27daa594
r8: 0x16d0df20 r9: 0x00000001 r10: 0x40340000 r11: 0x00000001
ip: 0x00000148 sp: 0x27daa588 lr: 0x3824aa33 pc: 0x381e11fc
cpsr: 0x00000010
My app was rejected, but I don't know what's the problem.
Rejected reason is:
We found that your app crashed on iPhone 4 running iOS 5.0.1, which is not in compliance with the App Store Review Guidelines.
Your app crashed on both Wi-Fi and cellular networks
when we:
1) Launch the app connected to a Wi-Fi or cellular network
2) The app crashes.
But, I test the my app withe iphone 4 running ios 5.0.1 which didn't come out crash like that, so I'm confused, plz help me, thanks a million.
Incident Identifier: AAA90ABE-B2F1-483A-97B8-2990DF83698C
CrashReporter Key: 52a7dd4ac386930f5f86a0b0e9b2de47158609a3
Hardware Model: iPhone3,1
Process: *****
Path: *******
Identifier: *****
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-01-26 17:51:05.914 -0800
OS Version: iPhone OS 5.0.1 (9A405)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x35fd832c 0x35fc7000 + 70444
1 libsystem_c.dylib 0x32ea1f54 0x32e54000 + 319316
2 libsystem_c.dylib 0x32e9afe4 0x32e54000 + 290788
3 libc++abi.dylib 0x334e4f64 0x334de000 + 28516
4 libc++abi.dylib 0x334e23ea 0x334de000 + 17386
5 libc++abi.dylib 0x334e244a 0x334de000 + 17482
6 libc++abi.dylib 0x334e381e 0x334de000 + 22558
7 libobjc.A.dylib 0x3430d22e 0x34304000 + 37422
8 CoreFoundation 0x3401353e 0x34004000 + 62782
9 CoreFoundation 0x3401339e 0x34004000 + 62366
10 GraphicsServices 0x30897fc6 0x30894000 + 16326
11 UIKit 0x3749473c 0x37463000 + 202556
12 *******(app's name) 0x00003e74 0x1000 + 11892
13 ******* 0x00003e2c 0x1000 + 11820
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x35fc83b4 0x35fc7000 + 5044
1 libdispatch.dylib 0x36cf2e78 0x36ce6000 + 52856
2 libdispatch.dylib 0x36cf2b96 0x36ce6000 + 52118
Thread 2 name: Dispatch queue: com.apple.root.default-priority
Thread 2:
0 DataDetectorsCore 0x37a54828 0x37a4e000 + 26664
1 DataDetectorsCore 0x37a5456c 0x37a4e000 + 25964
2 DataDetectorsCore 0x37a51b90 0x37a4e000 + 15248
3 DataDetectorsCore 0x37a520b8 0x37a4e000 + 16568
4 DataDetectorsCore 0x37a50da8 0x37a4e000 + 11688
5 DataDetectorsUI 0x34613db6 0x3460e000 + 23990
6 Foundation 0x35a2e39c 0x35a03000 + 177052
7 Foundation 0x35a9779c 0x35a03000 + 608156
8 libdispatch.dylib 0x36ce6d4e 0x36ce6000 + 3406
9 libdispatch.dylib 0x36cf279c 0x36ce6000 + 51100
10 libsystem_c.dylib 0x32e5e1c8 0x32e54000 + 41416
11 libsystem_c.dylib 0x32e5e09c 0x32e54000 + 41116
Thread 3 name: WebThread
Thread 3:
0 libsystem_kernel.dylib 0x35fc8010 0x35fc7000 + 4112
1 libsystem_kernel.dylib 0x35fc8206 0x35fc7000 + 4614
2 CoreFoundation 0x3409141c 0x34004000 + 578588
3 CoreFoundation 0x34090154 0x34004000 + 573780
4 CoreFoundation 0x340134d6 0x34004000 + 62678
5 CoreFoundation 0x3401339e 0x34004000 + 62366
6 WebCore 0x364e7128 0x3643f000 + 688424
7 libsystem_c.dylib 0x32e63c16 0x32e54000 + 64534
8 libsystem_c.dylib 0x32e63ad0 0x32e54000 + 64208
Thread 4:
0 libsystem_kernel.dylib 0x35fd8cd4 0x35fc7000 + 72916
1 libsystem_c.dylib 0x32e5e30a 0x32e54000 + 41738
2 libsystem_c.dylib 0x32e5e09c 0x32e54000 + 41116
Thread 5 name: com.apple.NSURLConnectionLoader
Thread 5:
0 libsystem_kernel.dylib 0x35fc8010 0x35fc7000 + 4112
1 libsystem_kernel.dylib 0x35fc8206 0x35fc7000 + 4614
2 CoreFoundation 0x3409141c 0x34004000 + 578588
3 CoreFoundation 0x34090154 0x34004000 + 573780
4 CoreFoundation 0x340134d6 0x34004000 + 62678
5 CoreFoundation 0x3401339e 0x34004000 + 62366
6 Foundation 0x35a13bc2 0x35a03000 + 68546
7 Foundation 0x35a13a8a 0x35a03000 + 68234
8 Foundation 0x35aa759a 0x35a03000 + 673178
9 libsystem_c.dylib 0x32e63c16 0x32e54000 + 64534
10 libsystem_c.dylib 0x32e63ad0 0x32e54000 + 64208
Thread 6:
0 libsystem_kernel.dylib 0x35fd8cd4 0x35fc7000 + 72916
1 libsystem_c.dylib 0x32e5e30a 0x32e54000 + 41738
2 libsystem_c.dylib 0x32e5e09c 0x32e54000 + 41116
Thread 7:
0 libsystem_kernel.dylib 0x35fd8cd4 0x35fc7000 + 72916
1 libsystem_c.dylib 0x32e5e30a 0x32e54000 + 41738
2 libsystem_c.dylib 0x32e5e09c 0x32e54000 + 41116
Thread 8 name: com.apple.CFSocket.private
Thread 8:
0 libsystem_kernel.dylib 0x35fd8570 0x35fc7000 + 71024
1 CoreFoundation 0x3409566a 0x34004000 + 595562
2 libsystem_c.dylib 0x32e63c16 0x32e54000 + 64534
3 libsystem_c.dylib 0x32e63ad0 0x32e54000 + 64208
Thread 9:
0 libsystem_kernel.dylib 0x35fd8cd4 0x35fc7000 + 72916
1 libsystem_c.dylib 0x32e5e30a 0x32e54000 + 41738
2 libsystem_c.dylib 0x32e5e09c 0x32e54000 + 41116
Thread 0 crashed with ARM Thread State:
r0: 0x00000000 r1: 0x00000000 r2: 0x00000001 r3: 0x00000000
r4: 0x00000006 r5: 0x3e78bce8 r6: 0x00000002 r7: 0x2fdffb1c
r8: 0x3f448d6c r9: 0x334e5a32 r10: 0x00000000 r11: 0x3f448d6c
ip: 0x00000148 sp: 0x2fdffb10 lr: 0x32ea1f5b pc: 0x35fd832c
cpsr: 0x00070010
1) If you are not using ARC, convert your project to ARC. That will make crashes like this much less likley.
2) To see where in your code you crashed, you need to desymbolicate the crash log so it will show you where in your code the call that crashed came from. Try following these instructions:
Symbolicating iPhone App Crash Reports
According to EveryMac, iPhone3,1 is the GSM model of the iPhone 4.
Did you test with a GSM model, or a CDMA model? This crash may only happen with the GSM model.
Im somewhat stuck, and need to have this resolved because one of my apps is exhibiting random crashes which cannot always be reproduced. This is one of the crash logs:
Incident Identifier: 59865612-9F00-44EA-9474-2BF607AD662E
CrashReporter Key: bea17b7f4237e78a13ce60449d694621d0f16a44
Hardware Model: iPhone2,1
Process: APPNAME [82]
Path: /var/mobile/Applications/ACE9A1A2-F1BE-43E0-9775-1291723D4C4A/APPNAME.app/APPNAME
Identifier: APPNAME
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2011-05-21 19:10:27.893 +0100
OS Version: iPhone OS 4.3.3 (8J2)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000009
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 0x344507b4 __NSFireTimer + 112
2 CoreFoundation 0x3039ca40 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
3 CoreFoundation 0x3039eec4 __CFRunLoopDoTimer + 844
4 CoreFoundation 0x3039f83e __CFRunLoopRun + 1082
5 CoreFoundation 0x3032febc CFRunLoopRunSpecific + 224
6 CoreFoundation 0x3032fdc4 CFRunLoopRunInMode + 52
7 GraphicsServices 0x3448e418 0x3448a000 + 17432
8 GraphicsServices 0x3448e4c4 0x3448a000 + 17604
9 UIKit 0x33f3cd62 -[UIApplication _run] + 398
10 UIKit 0x33f3a800 UIApplicationMain + 664
11 APPNAME 0x00002d88 0x1000 + 7560
12 APPNAME 0x00002d3c 0x1000 + 7484
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x36100fbc kevent + 24
1 libdispatch.dylib 0x33d0b032 _dispatch_mgr_invoke + 706
2 libdispatch.dylib 0x33d0c03a _dispatch_queue_invoke + 86
3 libdispatch.dylib 0x33d0b5ea _dispatch_worker_thread2 + 186
4 libsystem_c.dylib 0x33e0a58a _pthread_wqthread + 258
5 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x360fdc00 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x360fd758 mach_msg + 44
2 CoreFoundation 0x3039d2b8 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x3039f562 __CFRunLoopRun + 350
4 CoreFoundation 0x3032febc CFRunLoopRunSpecific + 224
5 CoreFoundation 0x3032fdc4 CFRunLoopRunInMode + 52
6 WebCore 0x34c2627e RunWebThread(void*) + 382
7 libsystem_c.dylib 0x33e0930a _pthread_start + 242
8 libsystem_c.dylib 0x33e0abb4 thread_start + 0
Thread 3:
0 libsystem_kernel.dylib 0x360fdc00 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x360fd758 mach_msg + 44
2 CoreFoundation 0x3039d2b8 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x3039f562 __CFRunLoopRun + 350
4 CoreFoundation 0x3032febc CFRunLoopRunSpecific + 224
5 CoreFoundation 0x3032fdc4 CFRunLoopRunInMode + 52
6 Foundation 0x343ea7f6 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 206
7 Foundation 0x343dd382 -[NSThread main] + 38
8 Foundation 0x3444f5c6 __NSThread__main__ + 966
9 libsystem_c.dylib 0x33e0930a _pthread_start + 242
10 libsystem_c.dylib 0x33e0abb4 thread_start + 0
Thread 4 name: com.apple.CFSocket.private
Thread 4:
0 libsystem_kernel.dylib 0x360ffc60 __select + 20
1 CoreFoundation 0x303a28f2 __CFSocketManager + 582
2 libsystem_c.dylib 0x33e0930a _pthread_start + 242
3 libsystem_c.dylib 0x33e0abb4 thread_start + 0
Thread 5:
0 libsystem_kernel.dylib 0x361003ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x33e0a6d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 6:
0 libsystem_kernel.dylib 0x361003ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x33e0a6d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 7:
0 libsystem_kernel.dylib 0x361003ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x33e0a6d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 8:
0 libsystem_kernel.dylib 0x361003ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x33e0a6d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 0 crashed with ARM Thread State:
r0: 0x04246810 r1: 0x33738814 r2: 0x042b3704 r3: 0x00000000
r4: 0x00000001 r5: 0x00000001 r6: 0x00259330 r7: 0x2fdfeb30
r8: 0x002593d0 r9: 0x00000000 r10: 0x04241720 r11: 0x00000000
ip: 0x3fa3f4e8 sp: 0x2fdfea60 lr: 0x349077bb pc: 0x33dfcc98
cpsr: 0x280f0030
Can someone offer a suggestion as to what might be the cause ?
Thanks!
It looks like you have a timer firing and trying to send a message to an object that has been dealloc'ed.
Keyline here is: Exception Type: EXC_BAD_ACCESS (SIGBUS)
It occurs, when you are trying to access an object that has been released earlier. Since, you are trying to access an object in a timer's callback, what is possibly happening is that while the timer responds for an object, the object in question has been released.
You can track the object by enabling the NSZombie environment variable.
When you create a NSTimer it is critical that you hold on to the ref and then invalidate it if the object to be called goes away. Like so:
[self.bugZapTimer invalidate];
self.bugZapTimer = [NSTimer timerWithTimeInterval: 0.1
target: self
selector: #selector(bugZapTimer:)
userInfo: NULL
repeats: FALSE];
[[NSRunLoop currentRunLoop] addTimer:self.bugZapTimer forMode: NSDefaultRunLoopMode];
Then, in your dealloc method you must do:
[self.bugZapTimer invalidate];
self.bugZapTimer = nil;