2010-12-23 16 views
3

Meine App verwendet den Hintergrund für GPS-Updates. Ich habe es für Hintergrund-Standort-Updates registriert, und während es im Hintergrund läuft, stürzt es immer so ab.Warum ist diese App im Hintergrund abgestürzt?

Da ich den Großteil dieses Codes nicht geschrieben habe, habe ich wirklich keine Ahnung, was passiert ist.

Ich habe die Speicherzuweisungen überprüft und es scheint dort kein großes Problem zu sein. Hier ist ein Absturzbericht:

Incident Identifier: 39F6F622-1274-4B6C-BA19-32D10E04E309 
CrashReporter Key: 4757f4c5e5f009daf18eb0c512f729356c3e5de4 
Hardware Model:  iPhone3,1 
Process:   Get Off Now! [3040] 
Path:   /var/mobile/Applications/43D41F77-B225-4F47-AFB0-D2F2E00E18DF/Get Off Now!.app/Get Off Now! 
Identifier:  Get Off Now! 
Version:   ??? (???) 
Code Type:  ARM (Native) 
Parent Process: launchd [1] 

Date/Time:  2010-12-22 13:31:29.293 +0800 
OS Version:  iPhone OS 4.1 (8B117) 
Report Version: 104 

Exception Type: EXC_BAD_ACCESS (SIGBUS) 
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000d 
Crashed Thread: 0 

Thread 0 Crashed: 
0 libobjc.A.dylib     0x000027d8 objc_msgSend + 16 
1 CoreFoundation     0x000042ae CFRetain + 62 
2 CoreFoundation     0x0005ab58 CFMessagePortInvalidate + 304 
3 CoreFoundation     0x0005b05e CFMessagePortIsValid + 42 
4 CoreLocation     0x000030f8 CLClientIsValid + 12 
5 CoreLocation     0x00004b10 CLClientSendAndCache(__CLClient*, CLDaemonCommType, void*, int, unsigned char, unsigned char) + 40 
6 CoreLocation     0x000051cc CLClientHandleWatchdogTimerExpiry(__CFRunLoopTimer*, void*) + 24 
7 CoreFoundation     0x000567f4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8 
8 CoreFoundation     0x000562a6 __CFRunLoopDoTimer + 854 
9 CoreFoundation     0x0002779e __CFRunLoopRun + 1082 
10 CoreFoundation     0x00027270 CFRunLoopRunSpecific + 224 
11 CoreFoundation     0x00027178 CFRunLoopRunInMode + 52 
12 GraphicsServices    0x000045ec GSEventRunModal + 108 
13 GraphicsServices    0x00004698 GSEventRun + 56 
14 UIKit       0x0000411c -[UIApplication _run] + 396 
15 UIKit       0x00002128 UIApplicationMain + 664 
16 Get Off Now!     0x00002406 0x1000 + 5126 
17 Get Off Now!     0x000023d0 0x1000 + 5072 

Thread 1: 
0 libSystem.B.dylib    0x0002d330 kevent + 24 
1 libSystem.B.dylib    0x000d6b6c _dispatch_mgr_invoke + 88 
2 libSystem.B.dylib    0x000d65bc _dispatch_queue_invoke + 96 
3 libSystem.B.dylib    0x000d675c _dispatch_worker_thread2 + 120 
4 libSystem.B.dylib    0x0007a67a _pthread_wqthread + 258 
5 libSystem.B.dylib    0x00073190 start_wqthread + 0 

Thread 2: 
0 libSystem.B.dylib    0x00000cf4 semaphore_wait_signal_trap + 8 
1 libSystem.B.dylib    0x0002e4ee semaphore_wait_signal + 2 
2 libSystem.B.dylib    0x00002ae4 pthread_mutex_lock + 248 
3 WebCore       0x00002620 _WebTryThreadLock(bool) + 140 
4 WebCore       0x00002566 WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*) + 18 
5 CoreFoundation     0x00030236 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 10 
6 CoreFoundation     0x000300aa __CFRunLoopDoObservers + 406 
7 CoreFoundation     0x000276c0 __CFRunLoopRun + 860 
8 CoreFoundation     0x00027270 CFRunLoopRunSpecific + 224 
9 CoreFoundation     0x00027178 CFRunLoopRunInMode + 52 
10 WebCore       0x000024e2 RunWebThread(void*) + 362 
11 libSystem.B.dylib    0x0007a27e _pthread_start + 242 
12 libSystem.B.dylib    0x0006f2a8 thread_start + 0 

Thread 3: 
0 libSystem.B.dylib    0x0007b19c __workq_kernreturn + 8 
1 libSystem.B.dylib    0x0007a790 _pthread_wqthread + 536 
2 libSystem.B.dylib    0x00073190 start_wqthread + 0 

Thread 4: 
0 libSystem.B.dylib    0x0007b19c __workq_kernreturn + 8 
1 libSystem.B.dylib    0x0007a790 _pthread_wqthread + 536 
2 libSystem.B.dylib    0x00073190 start_wqthread + 0 

Thread 0 crashed with ARM Thread State: 
    r0: 0x001a01c0 r1: 0x33024270  r2: 0x00000005  r3: 0x3002d7c9 
    r4: 0x00000005 r5: 0x3e1af5e4  r6: 0x00000017  r7: 0x2fffeac0 
    r8: 0x00000004 r9: 0x001fc098  r10: 0x00855864  r11: 0x2fffeb48 
    ip: 0x3e19c3f0 sp: 0x2fffeaa8  lr: 0x307fc2b5  pc: 0x3002d7d8 
    cpsr: 0x20000030 

Dies ist eine andere Möglichkeit, es stürzt ab; es sieht gleich aus, außer es 100% CPU für eine lange Zeit verwendet:

Incident Identifier: 61B42F36-021F-48D2-B180-112527BAE5CF 
CrashReporter Key: 4757f4c5e5f009daf18eb0c512f729356c3e5de4 
Hardware Model:  iPhone3,1 
Process:   Get Off Now! [3751] 
Path:   /var/mobile/Applications/43D41F77-B225-4F47-AFB0-D2F2E00E18DF/Get Off Now!.app/Get Off Now! 
Identifier:  Get Off Now! 
Version:   ??? (???) 
Code Type:  ARM (Native) 
Parent Process: launchd [1] 

Date/Time:  2010-12-23 13:06:50.363 +0800 
OS Version:  iPhone OS 4.1 (8B117) 
Report Version: 104 

Exception Type: 00000020 
Exception Codes: 0x8badf00d 
Highlighted Thread: 0 

Application Specific Information: 
Get Off Now![3751] has active assertions beyond permitted time: 
{(
    <SBProcessAssertion: 0xca2a8a0> identifier: CoreLocationRegistration process: Get Off Now![3751] permittedBackgroundDuration: 600.000000 reason: finishTask owner pid:3751 preventSuspend preventIdleSleep 
)} 

Elapsed total CPU time (seconds): 600.010 (user 19.350, system 580.660), 100% CPU 
Elapsed application CPU time (seconds): 575.320, 96% CPU 

Thread 0: 
0 libSystem.B.dylib    0x00004f0c OSSpinLockLock + 44 
1 CoreFoundation     0x0005aa42 CFMessagePortInvalidate + 26 
2 CoreFoundation     0x0005b05e CFMessagePortIsValid + 42 
3 CoreLocation     0x000030f8 CLClientIsValid + 12 
4 CoreLocation     0x00004b10 CLClientSendAndCache(__CLClient*, CLDaemonCommType, void*, int, unsigned char, unsigned char) + 40 
5 CoreLocation     0x000051cc CLClientHandleWatchdogTimerExpiry(__CFRunLoopTimer*, void*) + 24 
6 CoreFoundation     0x000567f4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8 
7 CoreFoundation     0x000562a6 __CFRunLoopDoTimer + 854 
8 CoreFoundation     0x0002779e __CFRunLoopRun + 1082 
9 CoreFoundation     0x00027270 CFRunLoopRunSpecific + 224 
10 CoreFoundation     0x00027178 CFRunLoopRunInMode + 52 
11 GraphicsServices    0x000045ec GSEventRunModal + 108 
12 GraphicsServices    0x00004698 GSEventRun + 56 
13 UIKit       0x0000411c -[UIApplication _run] + 396 
14 UIKit       0x00002128 UIApplicationMain + 664 
15 Get Off Now!     0x000022de main (main.m:13) 
16 Get Off Now!     0x000022a8 start + 32 

Thread 1: 
0 libSystem.B.dylib    0x0002d330 kevent + 24 
1 libSystem.B.dylib    0x000d6b6c _dispatch_mgr_invoke + 88 
2 libSystem.B.dylib    0x000d65bc _dispatch_queue_invoke + 96 
3 libSystem.B.dylib    0x000d675c _dispatch_worker_thread2 + 120 
4 libSystem.B.dylib    0x0007a67a _pthread_wqthread + 258 
5 libSystem.B.dylib    0x00073190 start_wqthread + 0 

Thread 2: 
0 libSystem.B.dylib    0x00000c98 mach_msg_trap + 20 
1 libSystem.B.dylib    0x00002d64 mach_msg + 44 
2 CoreFoundation     0x00027c38 __CFRunLoopServiceMachPort + 88 
3 CoreFoundation     0x000274c2 __CFRunLoopRun + 350 
4 CoreFoundation     0x00027270 CFRunLoopRunSpecific + 224 
5 CoreFoundation     0x00027178 CFRunLoopRunInMode + 52 
6 WebCore       0x000024e2 RunWebThread(void*) + 362 
7 libSystem.B.dylib    0x0007a27e _pthread_start + 242 
8 libSystem.B.dylib    0x0006f2a8 thread_start + 0 

Unknown thread crashed with unknown flavor: 5, state_count: 1 
+0

Nur als Tipp, Sie brauchen nicht alle diese '
' s Sie hinzugefügt, um Ihre Formatierung zu beheben. Wählen Sie einfach den Text aus und tippen Sie auf die Code-Schaltfläche: ** {} ** (Wenn Sie wirklich zwei Zeilen zu Zeilenumbrüchen zusammenfügen möchten und nicht die Codeformatierung verwenden möchten, fügen Sie einfach zwei Leerzeichen am Ende jeder Zeile ein.) –

+1

An adressiere dein Problem, ist das zufällig unter iOS 4.1? Es gibt einen bekannten Fehler im Location Manager in 4.1. –

+0

Dies basiert auf iOS 4.0, läuft aber auf meinem iPhone 4 OS4.1 und iPad OS 4.2.1. Es ist interessant, dass OS4.2.1 viel seltener abgestürzt ist. Was ist das für ein Fehler? – john

Antwort

1

Ich glaube, Sie brauchen einige Objekte zu überprüfen, die von anderen Threads freigegeben werden, aber sie Haupt-Thread zugegriffen werden. Ich bin auf so etwas gestoßen, weil ich auf einige veröffentlichte Objekte zugegriffen habe.

+0

Ich habe fast bewiesen, dass dies ein iOS-abhängiger Fehler ist, hat jemand eine Idee, wenn es eine Workaround dafür gibt ??? – john

+2

Dies ist fast immer, weil ein Delegat nicht auf Null gesetzt wurde, oder ein performSelector wurde nicht abgebrochen, Sie haben das richtig gemacht. –

0

Ich hatte genau die gleichen Crash-Logs generiert. Ich habe einen Haupt-Thread, der eine NSOperationQueue verwendet, um einen Datendownload-Thread zu erzeugen, der dann performSelectorOnMainThread verwendet, wenn er fertig ist.

In meiner didupdatalocation-Methode durchlief ich ein Array und startete in einigen Fällen eine lokale Benachrichtigung. Es schien auf der zweiten Instanz einer lokalen Benachrichtigung fehlzuschlagen (für das gleiche Array-Element), aber ich kann mir nicht sicher sein. Ich habe versucht, die Logs zu symbolisieren, aber es gibt einige fehlende Dateifehler mit 4.2.1, also hatte ich Symbole aus 4.2 kopiert und konnte Atos nicht zur Arbeit bringen (aber das war wahrscheinlich meine Schuld).

Letzte Nacht habe ich die folgenden Änderungen, und alles scheint zu lösen:

1) alle self.locationManager Notation geändert nur Location

2) entfernt alles von der dealloc Methode in der AppDelegate (neben super)

Verwandte Themen