views:

270

answers:

2

Hello, 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) `
A: 

Are you deleting an object which has already been destroyed?

Jon-Eric
Can you please tell me if there are any tools i can find out about this in the existing iphone tools?
Nareshkumar
I don't think he is deleting an object which has already been destroyed. If that's the case, it should crash in the simulator as well. But in his case, it doesn't.
unknownthreat
A: 

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. Thus, occasionally, iPhone will flush the cached memory, so it may cause some views or objects to be released/deallocated unknowingly to your concern. The iPhone simulator will never invoke memory warning but on the real machine, this is what happen.

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". 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:

- (void)didReceiveMemoryWarning {
  [super didReceiveMemoryWarning]; 
}
unknownthreat
thanks.. I shall try to do this and will let u know the results.
Nareshkumar