question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Segmentation Fault on WebView

See original GitHub issue

Hi

I currently encounter the following segmentation fault when executing my native app. The app is using JavaFX 15 and the Client-Plugin 0.1.32

Thread 11 "lication Thread" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffda13b700 (LWP 20100)]
0x0000555556ad003a in JNIJavaCallWrappers_valistJavaCallTrampoline_9dd67e3bba6d2db198ca885f9086483598da07aa ()
(gdb) bt
#0  0x0000555556ad003a in JNIJavaCallWrappers_valistJavaCallTrampoline_9dd67e3bba6d2db198ca885f9086483598da07aa ()
#1  0x00005555588ee3d1 in JNIEnv_::CallStaticObjectMethod(_jclass*, _jmethodID*, ...) ()
#2  0x0000555558a1e658 in Java_com_sun_webkit_WebPage_twkGetDocument ()
#3  0x000055555766a771 in WebPage_twkGetDocument_dbdcdf171215ff493d40a047a5d1be32f7585d11 ()
#4  0x00007fffd9695bb8 in  ()
#5  0x00002aa9f8627a88 in  ()
#6  0x0000555558a1e5f0 in Java_com_sun_webkit_WebPage_twkGetDocument ()
#7  0x00007fffb4000b60 in  ()
#8  0x000000035e5cf828 in  ()
#9  0x00007fffb16ad000 in  ()
#10 0x000055555766a75b in WebPage_twkGetDocument_dbdcdf171215ff493d40a047a5d1be32f7585d11 ()
#11 0x00007fffda139220 in  ()
#12 0x00007fffda139fb0 in  ()
#13 0x000055555766299f in WebPage_getDocument_86d59bef0ab450215440f6d51bfd312ff45f53a8 ()
#14 0x00007fff544d2968 in  ()
#15 0x000055555eba9188 in  ()
#16 0x00007fffd9695c48 in  ()
#17 0x00002aaa7cdc3c48 in  ()
#18 0x00007fffd9695c48 in  ()
#19 0x000055555d947a80 in  ()
#20 0x000055555e5c0a18 in  ()

The reason for this is easy to find (but not how to solve this, though): On a regular JVM I use reflection to get rid of the WebViews white background via

documentProperty().addListener { _, _, _ ->
    try {
        // Use reflection to retrieve the WebEngine's private 'page' field.
        val f = WebEngine::class.java.getDeclaredField("page")
        f.isAccessible = true
        val page = f.get(engine) as WebPage
        page.setBackgroundColor(java.awt.Color(0, 0, 0, 0).rgb)
    } catch (e: Exception) {
    }
}

Why? Because I need the WebView to be transparent…

Is there a way to solve this without crashing the app? Maybe via som updated META-INF/subscrate/config/reflectionconfig.json or something similar for JNI related calls?

Thanks in advance, Daniel

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jperedadnrcommented, Sep 25, 2020

Well, that’s a total different issue… 😉

1reaction
jperedadnrcommented, Sep 24, 2020

Thanks, it worked for me for a small simple case. But you should be able to solve any similar issues in the same way.

Take care and get better soon!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webview segmentation fault · Issue #10691 · electron ...
The segfault occurs when I redirect the app to a local file instead asking the django server for it. So the app calls...
Read more >
WebView segmentation fault when loading javascript ...
I have a WebView that includes a Hyphenator.js library in this way: <script src="file:///android_asset/Hyphenator-min.js" type="text/javascript"></script>
Read more >
Android webview segfaults on display
Here is the segfault - looks to be OpenGL related - -does the webview use opengl for fonts? - Is there a font...
Read more >
JavaFx WebView get Segmentation Fault in SpringBoot Fat Jar
A DESCRIPTION OF THE PROBLEM : I have a SpringBoot Application that uses JavaFx and i added a Discord Oauth Authentication.
Read more >
RFR: 8264990: Fix segfault when accessing local storage ...
A segmentation fault is observed when local storage of a webview is >> accessed. At that time a new native thread is spun...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found