简体   繁体   中英

iOS crash in CoreLocation

I'm seeing this crash my iOS app after it's been running for 10 minutes:

Date/Time:       2012-02-22 15:26:41.415 -0800
OS Version:      iPhone OS 5.0.1 (9A405)
Report Version:  104

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

The offending thread:

Thread 6 name:  Dispatch queue: com.apple.locationd.registration.xpcq
Thread 6 Crashed:
0   libstdc++.6.dylib               0x33ed32f8 std::string::compare(std::string const&) const + 8
1   CoreLocation                    0x3095ad54 std::_Rb_tree<std::string, std::pair<std::string const, void ( block_pointer)(CLConnectionMessage*)>, std::_Select1st<std::pair<std::string const, void ( block_pointer)(CLConnectionMessage*)> >, std::less<std::string>, std::allocator<std::pair<std::string const, void ( block_pointer)(CLConnectionMessage*)> > >::find(std::string const&) + 32
2   CoreLocation                    0x30959964 CLConnection::handleMessage(CLConnectionMessage*) + 16
3   CoreLocation                    0x3095a78c __setEventHandler_block_invoke_0 + 360
4   libxpc.dylib                    0x37a428c2 __XPC_CONNECTION_EVENT_HANDLER_CALLOUT__ +    30
5   libxpc.dylib                    0x37a3bd5c _xpc_connection_recv_message + 500
6   libxpc.dylib                    0x37a3bb18 _xpc_connection_wakeup_recv + 160
7   libxpc.dylib                    0x37a3b9b8 _xpc_connection_wakeup2 + 1264
8   libxpc.dylib                    0x37a3b3f6 _xpc_connection_wakeup + 62
9   libdispatch.dylib               0x36d7821e _dispatch_source_invoke + 510
10  libdispatch.dylib               0x36d75b70 _dispatch_queue_invoke$VARIANT$up + 40
11  libdispatch.dylib               0x36d75caa _dispatch_queue_drain + 202
12  libdispatch.dylib               0x36d75b66 _dispatch_queue_invoke$VARIANT$up + 30
13  libdispatch.dylib               0x36d75caa _dispatch_queue_drain + 202
14  libdispatch.dylib               0x36d75b66 _dispatch_queue_invoke$VARIANT$up + 30
15  libdispatch.dylib               0x36d75caa _dispatch_queue_drain + 202
16  libdispatch.dylib               0x36d75b66 _dispatch_queue_invoke$VARIANT$up + 30
17  libdispatch.dylib               0x36d7676c _dispatch_worker_thread2 + 208
18  libsystem_c.dylib               0x32ee21c8 _pthread_wqthread + 288
19  libsystem_c.dylib               0x32ee209c start_wqthread + 0

The console doesn't give me any messages except to say that I have a crash. Any thoughts?

So after lots of digging I was able to repro the issue and find what was causing it. This seems to occur if you call -[CLLocationManager startUpdatingLocation] and -[CLLocationManager stopUpdatingLocation] in a tight loop.

我也遇到了这个麻烦,但仅在iOS 5.x上(在Simulator中测试,没有设备。)当我有多个位置管理器实例,并且都设置了委托时,似乎会发生这种情况。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM