BrowserComponent SIGSEGV crash Android

105 views
Skip to first unread message

babtu

unread,
Feb 4, 2014, 8:27:08 AM2/4/14
to codenameone...@googlegroups.com
Hi,
I am developing a CN1 application in which I have embedded a Browser Component to make use of Google Maps. I have 2 forms. When button on the first form is clicked, I'm passing data via JS Bridge to Google Maps API and the second form with Browser Component and Google Maps within it is shown. Everything is working fine, but..unfortunately, app is crashing randomly just before second form is shown. No exceptions, no dialogs, app just dissapears from the screen, so I used adb logcat to gather some information. Here's the log (I have problems attaching a file):

W/webview ( 4925):     at com.codename1.ui.Display.handleEvent(Display.java:1892)
W/webview ( 4925):     at com.codename1.ui.Display.edtLoopImpl(Display.java:994)
W/webview ( 4925):     at com.codename1.ui.Display.mainEDTLoop(Display.ja
F/libc    ( 4925): Fatal signal 11 (SIGSEGV) at 0x00000010 (code=1)
I/DEBUG   ( 4694): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 4694): Build fingerprint: 'samsung/kylessxx/kylessopen:4.0.4/IMM76I/S7560XXAME9:user/release-keys'
I/DEBUG   ( 4694): pid: 4925, tid: 4938  >>> com.foo.mobileapp <<<
I/DEBUG   ( 4694): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000010
I/DEBUG   ( 4694):  r0 00000000  r1 00c68880  r2 3f800000  r3 00000000
I/DEBUG   ( 4694):  r4 00c68880  r5 00c4bc20  r6 00000004  r7 0000000d
I/DEBUG   ( 4694):  r8 0000000d  r9 00000003  10 00000000  fp 00d57e5c
I/DEBUG   ( 4694):  ip 016e8014  sp 5138f580  lr 4fd7fe65  pc 4fd7fdd4  cpsr 08000030
I/DEBUG   ( 4694):  d0  00000000ffe5edf0  d1  0cf30ba10c090c30
I/DEBUG   ( 4694):  d2  c700000046fffe00  d3  0003000300030003
I/DEBUG   ( 4694):  d4  ff00e500ed00f000  d5  000d000d000d000d
I/DEBUG   ( 4694):  d6  02fd02af02c702d0  d7  02fd02af3f800000
I/DEBUG   ( 4694):  d8  3f0000003f800000  d9  000001d90000002d
I/DEBUG   ( 4694):  d10 443e000000000319  d11 9e9e7d7d9e9e9e9e
I/DEBUG   ( 4694):  d12 f7f7f7f7f7f7f7f7  d13 f7f7efeff7f7f7f7
I/DEBUG   ( 4694):  d14 f0f0f0f0f0f0f0f0  d15 f0f0efeff0f0f0f0
I/DEBUG   ( 4694):  d16 0010001000100010  d17 405f800000000000
I/DEBUG   ( 4694):  d18 c055c00000000000  d19 0000000000000000
I/DEBUG   ( 4694):  d20 3ff5555555555555  d21 8000000000000000
I/DEBUG   ( 4694):  d22 405d000000000000  d23 0000000000000000
I/DEBUG   ( 4694):  d24 0000000000000000  d25 3fe0000000000000
I/DEBUG   ( 4694):  d26 0000000000000000  d27 3fe0000000000000
I/DEBUG   ( 4694):  d28 0100010001000100  d29 3fe8000000000000
I/DEBUG   ( 4694):  d30 0000000000000000  d31 3ff5555555555555
I/DEBUG   ( 4694):  scr 88000012
I/DEBUG   ( 4694):
I/DEBUG   ( 4694):          #00  pc 003efdd4  /system/lib/libwebcore.so (_ZN5Layer4drawEP8SkCanvasf)
I/DEBUG   ( 4694):          #01  lr 4fd7fe65  /system/lib/libwebcore.so
I/DEBUG   ( 4694):
I/DEBUG   ( 4694): code around pc:
I/DEBUG   ( 4694): 4fd7fdb4 ee188a68 ee181a10 f50d2a90 ecbded7e  h........*..~...
I/DEBUG   ( 4694): 4fd7fdc4 bd708b02 41f0e92d 2a10ee07 8b02ed2d  ..p.-..A...*-...
I/DEBUG   ( 4694): 4fd7fdd4 7a04edd0 8a27ee27 4605b08a eeb5460c  ...z'.'....F.F..
I/DEBUG   ( 4694): 4fd7fde4 eef18ac0 d941fa10 f50d4608 2103ebfe  ......A..F.....!
I/DEBUG   ( 4694): 4fd7fdf4 68204680 462068c2 46284790 f7ff4669  .F h.h F.G(FiF..
I/DEBUG   ( 4694):
I/DEBUG   ( 4694): code around lr:
I/DEBUG   ( 4694): 4fd7fe44 0154f105 6a9e4620 260047b0 46284631  ..T. F.j.G.&1F(F
I/DEBUG   ( 4694): 4fd7fe54 ff5cf7ff 46213601 2a10ee18 ffb2f7ff  ..\..6!F...*....
I/DEBUG   ( 4694): 4fd7fe64 d1f342be 46414620 ec22f50b ecbdb00a  .B.. FAF..".....
I/DEBUG   ( 4694): 4fd7fe74 e8bd8b02 bf0081f0 b5f04288 b08b4604  .........B...F..
I/DEBUG   ( 4694): 4fd7fe84 4616460d 4610d103 eca8f50b 4611e024  .F.F...F....$..F
I/DEBUG   ( 4694):
I/DEBUG   ( 4694): stack:
I/DEBUG   ( 4694):     5138f540  0000000e 
I/DEBUG   ( 4694):     5138f544  4068dec4  /system/lib/libskia.so
I/DEBUG   ( 4694):     5138f548  00c68880  [heap]
I/DEBUG   ( 4694):     5138f54c  00c4c538  [heap]
I/DEBUG   ( 4694):     5138f550  00000003 
I/DEBUG   ( 4694):     5138f554  4fd7fe71  /system/lib/libwebcore.so
I/DEBUG   ( 4694):     5138f558  3f800000 
I/DEBUG   ( 4694):     5138f55c  00000000 
I/DEBUG   ( 4694):     5138f560  c2680000 
I/DEBUG   ( 4694):     5138f564  00000000 
I/DEBUG   ( 4694):     5138f568  3f800000 
I/DEBUG   ( 4694):     5138f56c  c2e00000 
I/DEBUG   ( 4694):     5138f570  00000000 
I/DEBUG   ( 4694):     5138f574  00000000 
I/DEBUG   ( 4694):     5138f578  df0027ad 
I/DEBUG   ( 4694):     5138f57c  00000000 
I/DEBUG   ( 4694): #00 5138f580  3f800000 
I/DEBUG   ( 4694):     5138f584  3f000000 
I/DEBUG   ( 4694):     5138f588  00c68880  [heap]
I/DEBUG   ( 4694):     5138f58c  00c4bc20  [heap]
I/DEBUG   ( 4694):     5138f590  00000004 
I/DEBUG   ( 4694):     5138f594  0000000d 
I/DEBUG   ( 4694):     5138f598  0000000d 
I/DEBUG   ( 4694):     5138f59c  4fd7fe65  /system/lib/libwebcore.so
I/DEBUG   ( 4694):     5138f5a0  3f800000 
I/DEBUG   ( 4694):     5138f5a4  00000000 
I/DEBUG   ( 4694):     5138f5a8  00000000 
I/DEBUG   ( 4694):     5138f5ac  00000000 
I/DEBUG   ( 4694):     5138f5b0  3f800000 
I/DEBUG   ( 4694):     5138f5b4  00000000 
I/DEBUG   ( 4694):     5138f5b8  00000000 
I/DEBUG   ( 4694):     5138f5bc  00000000 
I/DEBUG   ( 4694):     5138f5c0  3f800000 
I/DEBUG   ( 4694):     5138f5c4  00c4b910  [heap]

Device: Samsung Galaxy Trend GT-S7560
OS: Android 4.0.4

Before posting I did a little research and found that somebody had a similar problem (sigsegv crash in galaxy s3 android webview). Is it Android bug, CN1 bug or am I doing something wrong? Is there any solution? Thank you in advance.

Shai Almog

unread,
Feb 4, 2014, 3:10:57 PM2/4/14
to codenameone...@googlegroups.com
Hi,
there seem to be lines above the pasted section that might be relevant and help us specifically whats above this:

W/webview ( 4925):     at com.codename1.ui.Display.handleEvent(Display.java:1892)

Generally I think its an Android bug but ideally I'd like to have a workaround for it. Unfortunately I'm not aware of such.
Did you try the suggestion from the thread you linked of adding these to your head statement:
<meta name="format-detection" content="telephone=no" />
<meta name="format-detection" content="email=no" />
<meta name="format-detection" content="address=no"/>

babtu

unread,
Feb 5, 2014, 3:12:38 AM2/5/14
to codenameone...@googlegroups.com
Yes, I tried. Adding these lines significantly lowered frequency of crashes but have not eliminated them. In addition, sometimes form with BrowserComponent simply don't appear after clicking the button - can't see anything suspicious in logcat. Before trying workaround you mentioned, it was not happening. Lines that you requested (last line of this paste is first line of previous):

W/webview ( 4925):     at com.codename1.ui.Display.handleEvent(Display.java:1892)
W/webview ( 4925):     at com.codename1.ui.Display.edtLoopImpl(Display.java:994)
W/webview ( 4925):     at com.codename1.ui.Display.mainEDTLoop(Display.ja
W/webview ( 4925): java.lang.Throwable: Warning: A WebView method was called on thread 'EDT'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads.
W/webview ( 4925):     at android.webkit.WebView.checkThread(WebView.java:15142)
W/webview ( 4925):     at android.webkit.WebView.getSettings(WebView.java:5725)
W/webview ( 4925):     at android.webkit.WebView.getVisibleTitleHeightImpl(WebView.java:2533)
W/webview ( 4925):     at android.webkit.WebView.calcOurContentVisibleRectF(WebView.java:4204)
W/webview ( 4925):     at android.webkit.WebView.drawCoreAndCursorRing(WebView.java:6942)
W/webview ( 4925):     at android.webkit.WebView.drawContent(WebView.java:6061)
W/webview ( 4925):     at android.webkit.WebView.onDraw(WebView.java:6263)
W/webview ( 4925):     at android.view.View.draw(View.java:11120)
W/webview ( 4925):     at com.codename1.impl.android.AndroidImplementation$AndroidBrowserComponent.generatePeerImage(AndroidImplementation.java:3127)
W/webview ( 4925):     at com.codename1.ui.PeerComponent.getPeerImage(PeerComponent.java:64)
W/webview ( 4925):     at com.codename1.ui.PeerComponent.paint(PeerComponent.java:206)
W/webview ( 4925):     at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
W/webview ( 4925):     at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
W/webview ( 4925):     at com.codename1.ui.Component.paintInternal(Component.java:984)
W/webview ( 4925):     at com.codename1.ui.Container.paint(Container.java:950)
W/webview ( 4925):     at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
W/webview ( 4925):     at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
W/webview ( 4925):     at com.codename1.ui.Component.paintInternal(Component.java:984)
W/webview ( 4925):     at com.codename1.ui.Container.paint(Container.java:950)
W/webview ( 4925):     at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
W/webview ( 4925):     at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
W/webview ( 4925):     at com.codename1.ui.Component.paintInternal(Component.java:984)
W/webview ( 4925):     at com.codename1.ui.Container.paint(Container.java:950)
W/webview ( 4925):     at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
W/webview ( 4925):     at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
W/webview ( 4925):     at com.codename1.ui.Component.paintInternal(Component.java:984)
W/webview ( 4925):     at com.codename1.ui.Container.paint(Container.java:950)
W/webview ( 4925):     at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
W/webview ( 4925):     at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
W/webview ( 4925):     at com.codename1.ui.Component.paintInternal(Component.java:984)
W/webview ( 4925):     at com.codename1.ui.Container.paint(Container.java:950)
W/webview ( 4925):     at com.codename1.ui.Form.paint(Form.java:2726)
W/webview ( 4925):     at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
W/webview ( 4925):     at com.codename1.ui.Form.internalPaintImpl(Form.java:2736)
W/webview ( 4925):     at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
W/webview ( 4925):     at com.codename1.ui.Component.paintInternal(Component.java:984)
W/webview ( 4925):     at com.codename1.ui.Component.paintInternal(Component.java:952)
W/webview ( 4925):     at com.codename1.ui.Component.paintComponent(Component.java:1229)
W/webview ( 4925):     at com.codename1.ui.animations.CommonTransitions.paint(CommonTransitions.java:1152)
W/webview ( 4925):     at com.codename1.ui.animations.CommonTransitions.paint(CommonTransitions.java:1114)
W/webview ( 4925):     at com.codename1.ui.animations.CommonTransitions.initTransition(CommonTransitions.java:570)
W/webview ( 4925):     at com.codename1.ui.Display.initTransition(Display.java:1348)
W/webview ( 4925):     at com.codename1.ui.Display.setCurrent(Display.java:1301)
W/webview ( 4925):     at com.codename1.ui.Form.show(Form.java:1303)
W/webview ( 4925):     at com.codename1.ui.Form.show(Form.java:1281)
W/webview ( 4925):     at userclasses.StateMachine.onMain_RouteHistoryListAction(StateMachine.java:786)
W/webview ( 4925):     at generated.StateMachineBase.handleComponentAction(StateMachineBase.java:1380)
W/webview ( 4925):     at com.codename1.ui.util.UIBuilder$FormListener.actionPerformed(UIBuilder.java:2729)
W/webview ( 4925):     at com.codename1.ui.util.EventDispatcher.fireActionSync(EventDispatcher.java:421)
W/webview ( 4925):     at com.codename1.ui.util.EventDispatcher.fireActionEvent(EventDispatcher.java:357)
W/webview ( 4925):     at com.codename1.ui.List.fireActionEvent(List.java:1479)
W/webview ( 4925):     at com.codename1.ui.List.pointerReleasedImpl(List.java:1958)
W/webview ( 4925):     at com.codename1.ui.List.pointerReleased(List.java:1968)
W/webview ( 4925):     at com.codename1.ui.Form.pointerReleased(Form.java:2266)
W/webview ( 4925):     at com.codename1.ui.Component.pointerReleased(Component.java:2332)
First line of previous paste >> W/webview ( 4925):     at com.codename1.ui.Display.handleEvent(Display.java:1892) << First line of previous paste

As you can see, they represent full cycle, i. e. opening form with Browser Component ->  closing -> opening it again -> crash.

babtu

unread,
Feb 5, 2014, 9:37:36 AM2/5/14
to codenameone...@googlegroups.com
I just noticed that when I create a new Browser Component object in List Action Event Function and add it to the newly created form every time the List Element is clicked, problem disappears. No more crashing, rock stable. However, I'm not satisfied with that solution. Memory usage is raised (important for low-end smartphones) and map load time is noticeable longer what makes using the app uncomfortable and spoils the whole impression. I have no idea why that modification helps, because previous version of app could crash even at the first time the map form was called (so Browser Component object was "brand new", only difference was that it was StateMachine field initialized once in initVars()). Logcat now looks different:

W/webview ( 6681): java.lang.Throwable: Warning: A WebView method was called on thread 'EDT'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads.
W/webview ( 6681):     at android.webkit.WebView.checkThread(WebView.java:15142)
W/webview ( 6681):     at android.webkit.WebView.getSettings(WebView.java:5725)
W/webview ( 6681):     at android.webkit.WebView.getVisibleTitleHeightImpl(WebView.java:2533)
W/webview ( 6681):     at android.webkit.WebView.getViewHeight(WebView.java:2575)
W/webview ( 6681):     at android.webkit.WebView.computeVerticalScrollExtent(WebView.java:4396)
W/webview ( 6681):     at android.view.View.onDrawScrollBars(View.java:9534)
W/webview ( 6681):     at android.view.View.draw(View.java:11126)
W/webview ( 6681):     at com.codename1.impl.android.AndroidImplementation$AndroidBrowserComponent.generatePeerImage(AndroidImplementation.java:3111)
W/webview ( 6681):     at com.codename1.ui.PeerComponent.getPeerImage(PeerComponent.java:64)
W/webview ( 6681):     at com.codename1.ui.PeerComponent.paint(PeerComponent.java:206)
W/webview ( 6681):     at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
W/webview ( 6681):     at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
W/webview ( 6681):     at com.codename1.ui.Component.paintInternal(Component.java:984)
W/webview ( 6681):     at com.codename1.ui.Container.paint(Container.java:950)
W/webview ( 6681):     at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
W/webview ( 6681):     at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
W/webview ( 6681):     at com.codename1.ui.Component.paintInternal(Component.java:984)
W/webview ( 6681):     at com.codename1.ui.Container.paint(Container.java:950)
W/webview ( 6681):     at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
W/webview ( 6681):     at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
W/webview ( 6681):     at com.codename1.ui.Component.paintInternal(Component.java:984)
W/webview ( 6681):     at com.codename1.ui.Container.paint(Container.java:950)
W/webview ( 6681):     at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
W/webview ( 6681):     at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
W/webview ( 6681):     at com.codename1.ui.Component.paintInternal(Component.java:984)
W/webview ( 6681):     at com.codename1.ui.Container.paint(Container.java:950)
W/webview ( 6681):     at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
W/webview ( 6681):     at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
W/webview ( 6681):     at com.codename1.ui.Component.paintInternal(Component.java:984)
W/webview ( 6681):     at com.codename1.ui.Container.paint(Container.java:950)
W/webview ( 6681):     at com.codename1.ui.Form.paint(Form.java:2726)
W/webview ( 6681):     at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
W/webview ( 6681):     at com.codename1.ui.Form.internalPaintImpl(Form.java:2736)
W/webview ( 6681):     at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
W/webview ( 6681):     at com.codename1.ui.Component.paintInternal(Component.java:984)
W/webview ( 6681):     at com.codename1.ui.Component.paintInternal(Component.java:952)
W/webview ( 6681):     at com.codename1.ui.Component.paintComponent(Component.java:1229)
W/webview ( 6681):     at com.codename1.ui.animations.CommonTransitions.paint(CommonTransitions.java:1152)
W/webview ( 6681):     at com.codename1.ui.animations.CommonTransitions.paint(CommonTransitions.java:1114)
W/webview ( 6681):     at com.codename1.ui.animations.CommonTransitions.initTransition(CommonTransitions.java:570)
W/webview ( 6681):     at com.codename1.ui.Display.paintTransitionAnimation(Display.java:841)
W/webview ( 6681):     at com.codename1.ui.Display.edtLoopImpl(Display.java:972)
W/webview ( 6681):     at com.codename1.ui.Display.mainEDTLoop(Display.java:925)
W/webview ( 6681):     at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
W/webview ( 6681):     at com.codename1.impl.CodenameOneThread$1.run(CodenameOneThread.java:60)
W/webview ( 6681):     at java.lang.Thread.run(Thread.java:856)

I'm new to Java, CN1 and mobile development, so I don't know what does it all mean, but I feel that it could bring us closer to finding the reason of crashes.

Shai Almog

unread,
Feb 5, 2014, 11:52:57 AM2/5/14
to codenameone...@googlegroups.com
The exception you are seeing is fixable I just committed a fix for this to SVN. It should be up in the next update to the build server.
I'm asking Chen to review this before we send this to the servers.

babtu

unread,
Feb 6, 2014, 7:57:46 AM2/6/14
to codenameone...@googlegroups.com
You are really fast, thank you very much! Works like a charm.
Reply all
Reply to author
Forward
0 new messages