From: Arno P. <ar...@pu...> - 2009-11-20 07:04:32
|
can you please send the original Java source as well? Generally, the NSAutoReleasePool on the device is more aggressive in reclaiming memory than the one on the desktop. That in my experience sometimes explains the different behavior on the desktop and the device. What most likely happens is that an object is dealloced but later still being referenced. These are called zombie objects. You can track those in Objective-C by setting a certain property. In Xcode, go to Project > Edit Active Executable. Then add another variable. Call it 'NSZombieEnabled' and set its value to 'YES'. That should give you a clue which object it is trying to access that has already been destroyed (assuming that this is the problem). Arno Markus Heberling wrote: > Hi again, > > got another crash. This time it's really weird I think. It works on the Simulator, but crashes on the device. Problem is, I can't construct an easy Test case that demonstrates it... > > //_stack has a size of 6 > _stack[_sp++].i = _op1.i; > //sp==6 here > _stack[_sp++].o = _locals[0].o; > //sp==7 here on simulator, but on the iPhone its some value like 3390961 > _op1.o = _stack[--_sp].o; > //crash here on the device obviously. If I put a breakpoint here and change _sp to 7, all is fine. > > If I change the size of _stack to 7, its also not crashing. > > But changing it to > _stack[_sp++].i = _op1.i; > _stack[_sp].o = _locals[0].o; > _op1.o = _stack[_sp].o; > does crash. > > I have no clue what is causing it. Maybe you can see something or have an idea. As I daid I couldn't construct a simple test, so I here is the complete generated method: > > - (void) run__ > { > XMLVMElem _stack[6]; > XMLVMElem _locals[4]; > int _sp = 0; > XMLVMElem _op1, _op2, _op3; > NSAutoreleasePool* _pool = [[NSAutoreleasePool alloc] init]; > _locals[0].o = self; > label4:; > _stack[_sp++].o = _locals[0].o; > _op1.o = _stack[--_sp].o; > _op2.o = [((javax_microedition_lcdui_Display_TickerPaintTask*) _op1.o) _GET_this_0]; > _stack[_sp++].o = _op2.o; > _sp -= 1; > _op1.o = [javax_microedition_lcdui_Display access$000___javax_microedition_lcdui_Display:_stack[_sp + 0].o]; > [_op1.o autorelease]; > _stack[_sp++].o = _op1.o; > _op1.o = _stack[--_sp].o; > if (_op1.o == [NSNull null]) goto label0; > _stack[_sp++].o = _locals[0].o; > _op1.o = _stack[--_sp].o; > _op2.o = [((javax_microedition_lcdui_Display_TickerPaintTask*) _op1.o) _GET_this_0]; > _stack[_sp++].o = _op2.o; > _sp -= 1; > _op1.o = [javax_microedition_lcdui_Display access$000___javax_microedition_lcdui_Display:_stack[_sp + 0].o]; > [_op1.o autorelease]; > _stack[_sp++].o = _op1.o; > _sp -= 1; > _op1.o = [((javax_microedition_lcdui_Displayable*) _stack[_sp].o) getTicker__]; > [_op1.o autorelease]; > _stack[_sp++].o = _op1.o; > _op1.o = _stack[--_sp].o; > _locals[1].o = _op1.o; > label6:; > _stack[_sp++].o = _locals[1].o; > _op1.o = _stack[--_sp].o; > if (_op1.o == [NSNull null]) goto label0; > _stack[_sp++].o = _locals[1].o; > _op1 = _stack[_sp - 1]; > _stack[_sp++] = _op1; > _op1.o = _stack[--_sp].o; > _locals[2].o = _op1.o; > _op1.o = _stack[--_sp].o; > @synchronized(_op1.o) { > } > @try { > _stack[_sp++].o = _locals[1].o; > _op1.o = _stack[--_sp].o; > _op2.i = [((javax_microedition_lcdui_Ticker*) _op1.o) _GET_resetTextPosTo]; > _stack[_sp++].i = _op2.i; > _stack[_sp++].i = -1; > _op2.i = _stack[--_sp].i; > _op1.i = _stack[--_sp].i; > if (_op1.i == _op2.i) goto label2; > _stack[_sp++].o = _locals[1].o; > _stack[_sp++].o = _locals[1].o; > _op1.o = _stack[--_sp].o; > _op2.i = [((javax_microedition_lcdui_Ticker*) _op1.o) _GET_resetTextPosTo]; > _stack[_sp++].i = _op2.i; > _op1.i = _stack[--_sp].i; > _op2.o = _stack[--_sp].o; > [((javax_microedition_lcdui_Ticker*) _op2.o) _PUT_textPos: _op1.i]; > _stack[_sp++].o = _locals[1].o; > _stack[_sp++].i = -1; > _op1.i = _stack[--_sp].i; > _op2.o = _stack[--_sp].o; > [((javax_microedition_lcdui_Ticker*) _op2.o) _PUT_resetTextPosTo: _op1.i]; > label2:; > _stack[_sp++].o = _locals[1].o; > _op1 = _stack[_sp - 1]; > _stack[_sp++] = _op1; > _op1.o = _stack[--_sp].o; > _op2.i = [((javax_microedition_lcdui_Ticker*) _op1.o) _GET_textPos]; > _stack[_sp++].i = _op2.i; > _op1.i = [javax_microedition_lcdui_Ticker _GET_PAINT_MOVE]; > _stack[_sp++].i = _op1.i; > _op2.i = _stack[--_sp].i; > _op1.i = _stack[--_sp].i; > _stack[_sp++].i = _op1.i - _op2.i; _op1.i = _stack[--_sp].i; > _op2.o = _stack[--_sp].o; > [((javax_microedition_lcdui_Ticker*) _op2.o) _PUT_textPos: _op1.i]; > _stack[_sp++].o = _locals[2].o; > } @catch (java_lang_Exception* _ex) { > _stack[_sp++].o = _ex; > goto label8; > } > goto label3; > label8:; > @try { > _op1.o = _stack[--_sp].o; > _locals[3].o = _op1.o; > _stack[_sp++].o = _locals[2].o; > } @catch (java_lang_Exception* _ex) { > _stack[_sp++].o = _ex; > goto label8; > } > _stack[_sp++].o = _locals[3].o; > _op1.o = _stack[--_sp].o; > @throw _op1.o; > label3:; > _stack[_sp++].o = _locals[0].o; > _op1.o = _stack[--_sp].o; > _op2.o = [((javax_microedition_lcdui_Display_TickerPaintTask*) _op1.o) _GET_this_0]; > _stack[_sp++].o = _op2.o; > _stack[_sp++].o = _locals[0].o; > _op1.o = _stack[--_sp].o; > _op2.o = [((javax_microedition_lcdui_Display_TickerPaintTask*) _op1.o) _GET_this_0]; > _stack[_sp++].o = _op2.o; > _sp -= 1; > _op1.o = [javax_microedition_lcdui_Display access$000___javax_microedition_lcdui_Display:_stack[_sp + 0].o]; > [_op1.o autorelease]; > _stack[_sp++].o = _op1.o; > _stack[_sp++].i = 0; > _stack[_sp++].i = 0; > _stack[_sp++].o = _locals[0].o; > _op1.o = _stack[--_sp].o; > _op2.o = [((javax_microedition_lcdui_Display_TickerPaintTask*) _op1.o) _GET_this_0]; > _stack[_sp++].o = _op2.o; > _sp -= 1; > _op1.o = [javax_microedition_lcdui_Display access$000___javax_microedition_lcdui_Display:_stack[_sp + 0].o]; > [_op1.o autorelease]; > _stack[_sp++].o = _op1.o; > _sp -= 1; > _op1.i = [((javax_microedition_lcdui_Displayable*) _stack[_sp].o) getWidth__]; > //start > _stack[_sp++].i = _op1.i; > _stack[_sp++].o = _locals[0].o; > _op1.o = _stack[--_sp].o; > //end > _op2.o = [((javax_microedition_lcdui_Display_TickerPaintTask*) _op1.o) _GET_this_0]; > _stack[_sp++].o = _op2.o; > _sp -= 1; > _op1.o = [javax_microedition_lcdui_Display access$000___javax_microedition_lcdui_Display:_stack[_sp + 0].o]; > [_op1.o autorelease]; > _stack[_sp++].o = _op1.o; > _sp -= 1; > _op1.i = [((javax_microedition_lcdui_Displayable*) _stack[_sp].o) getHeight__]; > _stack[_sp++].i = _op1.i; > _sp -= 6; > [((javax_microedition_lcdui_Display*) _stack[_sp].o) repaint___javax_microedition_lcdui_Displayable_int_int_int_int:_stack[_sp + 1].o:_stack[_sp + 2].i:_stack[_sp + 3].i:_stack[_sp + 4].i:_stack[_sp + 5].i]; > label0:; > [_pool release]; > return; > } > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > > ------------------------------------------------------------------------ > > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users |