我创建了一个应该运行的应用程序,直到我停止它为止。 它基本上做的是从连接另一个设备获取一些数据,并使用NSURLConnection定期将数据发送到服务器,并定期从服务器读取数据,并使用NSXMLParser将该数据可视化为图形。
我运行仪器来检查分配和泄漏。 完全没有泄漏。内存监视器显示一致的5.2MB。 Objectalloc图是稳定的,objectallo的净字节是480000,#net是6400左右。
问题是应用程序在大约12小时后停止(或崩溃)。 有什么可能的问题?我完全不知道从哪里开始发现问题,因为调试器和仪器都没有显示任何错误或问题。
[加入]
1。正如保罗的建议,我在模拟器上运行我的应用程序并在运行5小时后收到一些错误消息。
InAir(64628,0xa050c720) malloc: *** error for object 0xc015bc87: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
InAir(64628,0xa050c720) malloc: *** error for object 0xa0200100: pointer being freed was not allocated
InAir(64628,0xa050c720) malloc: *** error for object 0x2080a043: pointer being freed was not allocated
InAir(64628,0xa050c720) malloc: *** error for object 0x120100: pointer being freed was not allocated
InAir(64628,0xa050c720) malloc: *** error for object 0x34a00000: pointer being freed was not allocated
InAir(64628,0xa050c720) malloc: *** error for object 0xc1d3a1b1: pointer being freed was not allocated
InAir(64628,0xa050c720) malloc: *** error for object 0x46b0a1b1: pointer being freed was not allocated
InAir(64628,0xa050c720) malloc: *** error for object 0xc1d3a1b1: pointer being freed was not allocated
Program received signal: “EXC_BAD_ACCESS”.
2。关于NilObject的评论......我不知道组织者有崩溃日志。是的,它有。
Incident Identifier: 0ADC2722-BF4B-457F-A224-4A946810FB1F
CrashReporter Key: f62c1dc12071b63c1e21d612962ee6aad74b4503
Process: InAir [3154]
Path: /var/mobile/Applications/9471A5CA-97E1-4E52-A934-9CE33DC5A5DB/InAir.app/InAir
Identifier: InAir
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2009-02-21 21:37:36.786 -0500
OS Version: iPhone OS 2.2.1 (5H11a)
Report Version: 103
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x00000001, 0xe7ffdefe
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x300c8c18 objc_msgSend + 20
1 InAir 0x00003d34 0x1000 + 11572
2 Foundation 0x306942a0 __NSFireTimer + 132
3 CoreFoundation 0x30269d88 CFRunLoopRunSpecific + 2642
4 CoreFoundation 0x30269320 CFRunLoopRunInMode + 44
5 GraphicsServices 0x31567e58 GSEventRunModal + 268
6 UIKit 0x30a4fa6c -[UIApplication _run] + 520
7 UIKit 0x30a591d0 UIApplicationMain + 1132
8 InAir 0x000020b6 0x1000 + 4278
9 InAir 0x0000202c 0x1000 + 4140
Thread 0 crashed with ARM Thread State:
r0: 0x0013b920 r1: 0x301a2410 r2: 0x0013b920 r3: 0x301a2410
r4: 0xc004ea47 r5: 0x001203d0 r6: 0x001203d0 r7: 0x2fffef50
r8: 0x001203d0 r9: 0x394346d0 r10: 0x001063b0 r11: 0x00000f03
ip: 0x0000a134 sp: 0x2fffeef8 lr: 0x00003d3b pc: 0x300c8c18
cpsr: 0x00000010
(等......整个日志都是here。)
有谁能解释这些?
答案 0 :(得分:3)
您是否尝试在malloc_error_break
上设置断点,因为错误消息会告诉您? (运行→管理断点→添加符号断点)。