wei-spring / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

iOS newVM crashes while logging #1303

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please clearly state whether the issue relates to a device/the simulator or the 
tools.
Device - iPad Air

If related to a device be sure to specify exactly which device with as much
details as possible.
iPad Air, iOS ver 8.1.2 - newVM

What steps will reproduce the problem?
1. Run the sample project
2. Visit any Website (works best with news websites like cnn)
3. Navigate through a few pages
4. The iOS App will crash after sometime

What version of the product are you using? On what operating system?
Latest cn1 newVM build server.

Please provide any additional information below.

JAVA_OBJECT 
virtual_java_lang_Thread_getName___R_java_lang_String(CODENAME_ONE_THREAD_STATE,
 JAVA_OBJECT  __cn1ThisObject) {
    if(__cn1ThisObject == JAVA_NULL) THROW_NULL_POINTER_EXCEPTION();
    //the crash happens if __cn1ThisObject->__codenameOneParentClsReference is null
    return (*(functionPtr_java_lang_Thread_getName___R_java_lang_String)__cn1ThisObject->__codenameOneParentClsReference->vtable[10])(threadStateData, __cn1ThisObject);
}

#0  0x00e7c68a in virtual_java_lang_Thread_getName___R_java_lang_String at 
java_lang_Thread.m:402
#1  0x002e03a0 in 
com_codename1_io_Log_getThreadAndTimeStamp___R_java_lang_String at 
com_codename1_io_Log.m:867
#2  0x002dc8da in com_codename1_io_Log_print___java_lang_String_int at 
com_codename1_io_Log.m:499
#3  0x002dc382 in com_codename1_io_Log_p___java_lang_String_int at 
com_codename1_io_Log.m:253
#4  0x002dc114 in com_codename1_io_Log_p___java_lang_String at 
com_codename1_io_Log.m:231
#5  0x00de4eb0 in 
com_example_ios_LoggingForm_2_shouldNavigate___java_lang_String_R_boolean at 
com_example_ios_LoggingForm_2.m:86
#6  0x0054c5d4 in 
virtual_com_codename1_ui_events_BrowserNavigationCallback_shouldNavigate___java_
lang_String_R_boolean at com_codename1_ui_events_BrowserNavigationCallback.m:58
#7  0x00f28630 in -[UIWebViewEventDelegate 
webView:shouldStartLoadWithRequest:navigationType:] at 
UIWebViewEventDelegate.m:68
#8  0x2e656f36 in -[UIWebView 
webView:decidePolicyForNavigationAction:request:frame:decisionListener:] ()
#9  0x2af90b14 in __invoking___ ()
#10 0x2aebd694 in -[NSInvocation invoke] ()
#11 0x2aec1116 in -[NSInvocation invokeWithTarget:] ()
#12 0x36ffd260 in -[_WebSafeForwarder forwardInvocation:] ()
#13 0x2af8f66e in ___forwarding___ ()
#14 0x2aec1058 in _CF_forwarding_prep_0 ()
#15 0x2af90b14 in __invoking___ ()
#16 0x2aebd694 in -[NSInvocation invoke] ()
#17 0x36527b70 in HandleDelegateSource(void*) ()
#18 0x2af52d56 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#19 0x2af52166 in __CFRunLoopDoSources0 ()
#20 0x2af507cc in __CFRunLoopRun ()
#21 0x2ae9e3c0 in CFRunLoopRunSpecific ()
#22 0x2ae9e1d2 in CFRunLoopRunInMode ()
#23 0x322420a8 in GSEventRunModal ()
#24 0x2e4adfa0 in UIApplicationMain ()
#25 0x00dfc270 in com_codename1_impl_ios_IOSNative_initVM__ at IOSNative.m:269
#26 0x0018c9ae in com_codename1_impl_ios_IOSImplementation_postInit__ at 
com_codename1_impl_ios_IOSImplementation.m:924
#27 0x0017d876 in 
virtual_com_codename1_impl_CodenameOneImplementation_postInit__ at 
com_codename1_impl_CodenameOneImplementation.m:14245
#28 0x004f9370 in com_codename1_ui_Display_init___java_lang_Object at 
com_codename1_ui_Display.m:1285
#29 0x00df21ee in 
com_example_ios_VMLoggingCrashStub_main___java_lang_String_1ARRAY at 
com_example_ios_VMLoggingCrashStub.m:462
#30 0x00df2286 in main at com_example_ios_VMCrashStub.m:472
#31 0x390d0aae in start ()

Original issue reported on code.google.com by appsepp....@gmail.com on 23 Jan 2015 at 12:21

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by st...@weblite.ca on 30 Jan 2015 at 4:25

GoogleCodeExporter commented 9 years ago
I have reproduced this error in iOS 8.1 running the New VM.  Removing the 
Log.p() call seems to prevent the error from happening.  Looking into it 
further. Will post more with results.

Original comment by steve.ha...@codenameone.com on 3 Feb 2015 at 8:15

GoogleCodeExporter commented 9 years ago
Other observations:
1. This does not seem to happen with the Old VM.  Only the new VM.
2. Sites like CNN expedite the crash because they use a lot of AJAX calls to 
load resources so the browser navigation callback gets called a lot more.
3. Memory warnings occur regularly whether or not a navigation callback is set. 
 The web view handles its own garbage though and generally is able to keep it 
going.

Theory:

The GC is failing to mark objects that are used inside the Web thread.  The 
browser navigation callback runs on the web thread, which CN1 does not start or 
control.  Perhaps the GC is ignoring objects that are in use in this thread in 
the mark stage - so they get swept away in the sweep stage.

This is more in your territory, Shai.

Original comment by steve.ha...@codenameone.com on 3 Feb 2015 at 8:30

GoogleCodeExporter commented 9 years ago
This is probably the same issue as 1328

Original comment by shai.almog on 5 Feb 2015 at 5:04

GoogleCodeExporter commented 9 years ago
Ran test again.  Appears to be holding steady now at about 115megs.  

Original comment by st...@weblite.ca on 6 Feb 2015 at 5:43