简体   繁体   English

iPhone怪异的设备崩溃,但未在模拟器中看到

[英]iphone weird crash on device but not seen in simulator

I tried to install and run one of my applications on device. 我试图在设备上安装并运行我的一个应用程序。 On a simulator, it was working fine. 在模拟器上,它运行良好。 But once on device, it crashes somehow. 但是一旦在设备上,它就会以某种方式崩溃。 I was trying to debug but i could not get anything there. 我正在尝试调试,但那里什么也没办法。 Here is what the debugger console shows.. Can someone please help me with this..: Here is the debugger log: 这是调试器控制台显示的内容。.有人可以帮助我吗..:这是调试器日志:

Program received signal EXC_BAD_ACCESS, Could not access memory.`
`Reason: KERN_PROTECTION_FAILURE at address: 0x00000000`
`[Switching to thread 12291]`
`0x327083e0 in _objc_selopt_data ()`
`Program received signal:  “EXC_BAD_ACCESS”.`

`Unable to disassemble _objc_selopt_data.`
(gdb) bt`
`#0  0x327083e0 in _objc_selopt_data ()`
`#1  0x32fb93c0 in WebCore::FrameLoader::detachFromParent ()`
`#2  0x303e1aec in -[WebView(WebPrivate) _close] ()`
`#3  0x303e19d8 in -[WebView close] ()`
`#4  0x303e1940 in -[WebView dealloc] ()`
`#5  0x32d86640 in -[NSObject release] ()`
`#6  0x32f4a294 in WebCoreObjCDeallocOnWebThreadImpl ()`
`#7  0x32f8b9c4 in HandleWebThreadReleaseSource ()`
`#8  0x32da43a6 in CFRunLoopRunSpecific ()`
`#9  0x32da3c1e in CFRunLoopRunInMode ()`
`#10 0x32f486f8 in RunWebThread ()`
`#11 0x327587b8 in _pthread_body ()`
`#12 0x00000000 in ?? ()`
`(gdb) `

您要删除已被销毁的对象吗?

I am not sure whether this is related or not, but I once ran into a similar problem. 我不确定这是否相关,但是我曾经遇到类似的问题。 The iPhone invokes the memory warning because it ran out of RAM. iPhone调用内存警告,因为它已用完RAM。 Thus, occasionally, iPhone will flush the cached memory, so it may cause some views or objects to be released/deallocated unknowingly to your concern. 因此,偶尔,iPhone会刷新缓存的内存,因此它可能会导致某些视图或对象在不知不觉的情况下被释放/取消分配。 The iPhone simulator will never invoke memory warning but on the real machine, this is what happen. iPhone模拟器永远不会调用内存警告,但在实际计算机上会发生这种情况。

I am not sure whether this is the case or not, but please try do this: on the iPhone simulator, there is an option to "Simulate memory warning". 我不确定是否是这种情况,但是请尝试执行以下操作:在iPhone模拟器上,有一个选项“模拟内存警告”。 Try play around with your app on the simulator and occasionally try to "simulate memory warning". 尝试在模拟器上玩弄您的应用,偶尔尝试“模拟内存警告”。 If it crashes, then we may conclude that this is the case. 如果崩溃,则可以得出结论。

Test it first whether this is the case. 首先测试是否是这种情况。

Alternatively, if you want to test when the real iPhone invokes "memory warning", try to put NSLog or printf in the following method: 另外,如果要测试真正的iPhone何时调用“内存警告”,请尝试将NSLog或printf放入以下方法:

- (void)didReceiveMemoryWarning {
  [super didReceiveMemoryWarning]; 
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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