有人知道为什么这个有时候会崩溃吗?我对这个问题感到困惑。我猜它崩溃的概率大约是100次中1次。
// from header file
struct _PTP_IP_Packet_INIT_EVENT_ACK {
uint32_t ptpIPPacketLength;
uint32_t ptpIPType;
};
typedef struct _PTP_IP_Packet_INIT_EVENT_ACK PTP_IP_Packet_INIT_EVENT_ACK;
#define PTP_IP_PacketLength_INIT_EVENT_ACK (2*sizeof(uint32_t))
最后一行出现了崩溃:
PTP_IP_Packet_INIT_EVENT_ACK eventack;
PTP_CNT_INIT(eventack);
len = [self.myWorker.eventInputStream read:(unsigned char*)&eventack maxLength:PTP_IP_PacketLength_INIT_EVENT_ACK];
崩溃数据:
#24
EXC_BREAKPOINT 0x0000000184045750
Crashed: PTPWork-192.168.1.1
0 CoreFoundation 0x184045750 CFHash + 256
1 CoreFoundation 0x184046c1c CFBasicHashGetCountOfKey + 960
2 CoreFoundation 0x184046810 CFSetContainsValue + 152
3 CoreFoundation 0x18407644c CFRunLoopRemoveSource + 236
4 CFNetwork 0x183b68fcc SocketStream::read(__CFReadStream*, unsigned char*, long, CFStreamError*, unsigned char*) + 520
5 CoreFoundation 0x184072c88 CFReadStreamRead + 520
6 Photobooth 0x1001348a0 -[PTPCamera initializeEventStreams] (PTPCamera.m:188)
7 Photobooth 0x100134398 -[PTPCamera initializePTP] (PTPCamera.m:127)
8 Photobooth 0x1001084b0 -[PTPWorker setState:] (PTPWorker.m:333)
9 Photobooth 0x100107b8c -[PTPWorker main] (PTPWorker.m:222)
10 Foundation 0x18505e308 __NSThread__main__ + 1072
11 libsystem_pthread.dylib 0x195babdc8 _pthread_body + 164
12 libsystem_pthread.dylib 0x195babd24 _pthread_body + 158
13 libsystem_pthread.dylib 0x195ba8ef8 thread_start + 4