2011-08-30 91 views
0

如果这是不是正确的论坛问这样的问题,请指向我的权利之一。帮助下面的崩溃转储

我正在使用的应用程序使用用户的位置并在满足某些条件时提醒用户。警报以振动形式和小文件的回放形式提供。在设备上进行测试期间,手机振动并且音频剪辑播放2秒(该剪辑长约9秒)并且应用程序崩溃。设备上的崩溃是一致的。在模拟器上,偶尔会看到崩溃但不一致。

掀起警报的触发是在CLLocation类 的委托方法 - (无效)的LocationManager:经理didUpdateToLocation:fromLocation:

下面的代码片段(ivLocMgr是一个实例变量)

if ((!ivAlertAlreadyShown) && (<test for trigger condition)) { 
    ivAlertAlreadyShown = YES; 

    [self obviousNotification]; 

    [ivLocMgr stopUpdatingLocation]; 
    [ivLocMgr release], ivLocMgr = nil; 
    } 

可以将[ivLocMgr stopUpdatingLocation];是根本原因吗?

任何和所有的帮助,非常感谢。 -S-

Incident Identifier: 8875BB08-4DAD-4FC7-8DC6-AA5D52D6FC78 
CrashReporter Key: f995a257bad99baa2fcf0f7d5b0ab3e77dce3a91 
Hardware Model:  iPhone2,1 
Process:   SAlert [360] 
Path:   /var/mobile/Applications/D3B5BAED-036C-4CFE-A735-A61D6ECCDAF6/SAlert.app/SpAlert 
Identifier:  SAlert 
Version:   ??? (???) 
Code Type:  ARM (Native) 
Parent Process: launchd [1] 

Date/Time:  2011-08-30 07:35:41.206 -0700 
OS Version:  iPhone OS 4.2.1 (8C148a) 
Report Version: 104 

Exception Type: EXC_BAD_ACCESS (SIGSEGV) 
Exception Codes: KERN_INVALID_ADDRESS at 0x46924508 
Crashed Thread: 0 

Thread 0 Crashed: 
0 libobjc.A.dylib    0x3199f464 objc_msgSend + 16 
1 CoreLocation     0x30e1f430 -[CLLocationManager onClientEventLocation:] + 560 
2 CoreLocation     0x30e1d68e -[CLLocationManager onClientEvent:supportInfo:] + 98 
3 CoreLocation     0x30e1d804 OnClientEvent + 16 
4 CoreLocation     0x30e19522 CLClientInvokeCallback(__CLClient*, CLClientEvent, __CFDictionary const*) + 42 
5 CoreLocation     0x30e1b3cc CLClientHandleDaemonDataLocation(__CLClient*, CLClientLocation const*, __CFDictionary const*) + 196 
6 CoreLocation     0x30e1b512 CLClientHandleDaemonData(__CFMessagePort*, long, __CFData const*, void*) + 286 
7 CoreFoundation    0x314913fe __CFMessagePortPerform + 242 
8 CoreFoundation    0x314656f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20 
9 CoreFoundation    0x314656bc __CFRunLoopDoSource1 + 160 
10 CoreFoundation    0x31457f76 __CFRunLoopRun + 514 
11 CoreFoundation    0x31457c80 CFRunLoopRunSpecific + 224 
12 CoreFoundation    0x31457b88 CFRunLoopRunInMode + 52 
13 GraphicsServices    0x35d664a4 GSEventRunModal + 108 
14 GraphicsServices    0x35d66550 GSEventRun + 56 
15 UIKit       0x338d5322 -[UIApplication _run] + 406 
16 UIKit       0x338d2e8c UIApplicationMain + 664 
17 StopAlert      0x00002f76 0x1000 + 8054 
18 StopAlert      0x00002f40 0x1000 + 8000 

Thread 1: 
0 libSystem.B.dylib    0x31192974 kevent + 24 
1 libSystem.B.dylib    0x3123c704 _dispatch_mgr_invoke + 88 
2 libSystem.B.dylib    0x3123c174 _dispatch_queue_invoke + 96 
3 libSystem.B.dylib    0x3123bb98 _dispatch_worker_thread2 + 120 
4 libSystem.B.dylib    0x311e024a _pthread_wqthread + 258 
5 libSystem.B.dylib    0x311d8970 start_wqthread + 0 

Thread 2: 
0 libSystem.B.dylib    0x31166268 mach_msg_trap + 20 
1 libSystem.B.dylib    0x31168354 mach_msg + 44 
2 CoreFoundation    0x31458648 __CFRunLoopServiceMachPort + 88 
3 CoreFoundation    0x31457ed2 __CFRunLoopRun + 350 
4 CoreFoundation    0x31457c80 CFRunLoopRunSpecific + 224 
5 CoreFoundation    0x31457b88 CFRunLoopRunInMode + 52 
6 WebCore      0x33d9f124 RunWebThread(void*) + 332 
7 libSystem.B.dylib    0x311df886 _pthread_start + 242 
8 libSystem.B.dylib    0x311d4a88 thread_start + 0 

Thread 3: 
0 libSystem.B.dylib    0x31166268 mach_msg_trap + 20 
1 libSystem.B.dylib    0x31168354 mach_msg + 44 
2 CoreFoundation    0x31458648 __CFRunLoopServiceMachPort + 88 
3 CoreFoundation    0x31457ed2 __CFRunLoopRun + 350 
4 CoreFoundation    0x31457c80 CFRunLoopRunSpecific + 224 
5 CoreFoundation    0x31457b88 CFRunLoopRunInMode + 52 
6 Foundation     0x31cf15f6 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 206 
7 Foundation     0x31ccf192 -[NSThread main] + 38 
8 Foundation     0x31cc8242 __NSThread__main__ + 966 
9 libSystem.B.dylib    0x311df886 _pthread_start + 242 
10 libSystem.B.dylib    0x311d4a88 thread_start + 0 

Thread 4: 
0 libSystem.B.dylib    0x3118a68c select$DARWIN_EXTSN + 20 
1 CoreFoundation    0x3148f662 __CFSocketManager + 582 
2 libSystem.B.dylib    0x311df886 _pthread_start + 242 
3 libSystem.B.dylib    0x311d4a88 thread_start + 0 

Thread 5: 
0 libSystem.B.dylib    0x31166268 mach_msg_trap + 20 
1 libSystem.B.dylib    0x31168354 mach_msg + 44 
2 CoreFoundation    0x31458648 __CFRunLoopServiceMachPort + 88 
3 CoreFoundation    0x31457ed2 __CFRunLoopRun + 350 
4 CoreFoundation    0x31457c80 CFRunLoopRunSpecific + 224 
5 CoreFoundation    0x31457b88 CFRunLoopRunInMode + 52 
6 MapKit      0x347a2906 TileCachePrivate::runCacheThread() + 274 
7 MapKit      0x347a27ea _runCacheThread(void*) + 2 
8 libSystem.B.dylib    0x311df886 _pthread_start + 242 
9 libSystem.B.dylib    0x311d4a88 thread_start + 0 

Thread 6: 
0 libSystem.B.dylib    0x311de9f0 __semwait_signal + 24 
1 libSystem.B.dylib    0x311937ec _pthread_cond_wait + 748 
2 libSystem.B.dylib    0x311933d2 pthread_cond_wait + 26 
3 QuartzCore     0x30a925dc CA::DispatchGroup::thread(void*) + 84 
4 QuartzCore     0x30a5f01a thread_fun + 10 
5 libSystem.B.dylib    0x311df886 _pthread_start + 242 
6 libSystem.B.dylib    0x311d4a88 thread_start + 0 

Thread 7: 
0 libSystem.B.dylib    0x31166268 mach_msg_trap + 20 
1 libSystem.B.dylib    0x31168354 mach_msg + 44 
2 libSystem.B.dylib    0x3118af5a thread_policy + 118 
3 libSystem.B.dylib    0x3118aed2 pthread_setschedparam_internal + 62 
4 libSystem.B.dylib    0x3118ae0e pthread_setschedparam + 70 
5 TextInput      0x31e8128a KB::kb_set_thread_priority(int) + 18 
6 TextInput      0x31e71f74 KB::BackgroundLoad(void*) + 84 
7 libSystem.B.dylib    0x311df886 _pthread_start + 242 
8 libSystem.B.dylib    0x311d4a88 thread_start + 0 

Thread 0 crashed with ARM Thread State: 
    r0: 0x0403000f r1: 0x33baf8ef  r2: 0x30e4bff6  r3: 0x00000001 
    r4: 0x46924500 r5: 0x30e1d7f5  r6: 0x00a01c64  r7: 0x2fdfec44 
    r8: 0x00000000 r9: 0x040fc098  r10: 0x00000000  r11: 0x00000000 
    ip: 0x3e16c584 sp: 0x2fdfeaa0  lr: 0x30e1f437  pc: 0x3199f464 
    cpsr: 0x200f0030 

回答

0

没有足够的代码有正确决定中止的原因。你得到的错误是告诉你,你正试图访问一个已经被释放的变量。我会从那里开始,并确保您没有在那里发布您的位置经理或其他变量。

1

发现在苹果开发者论坛的答案:

I needed to set the coreLocation instance's delegate to nil, when the alarm was triggered.