Summary: | [GTK] segfault creating GL context in VNC | ||
---|---|---|---|
Product: | WebKit | Reporter: | Thomas Klausner <tk> |
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW --- | ||
Severity: | Normal | CC: | bugs-noreply, cgarcia, clopez, magomez |
Priority: | P3 | Keywords: | Gtk |
Version: | Other | ||
Hardware: | PC | ||
OS: | Other |
Description
Thomas Klausner
2020-04-09 06:04:39 PDT
That's expected. To run without OpenGL you have to disable the hardware acceleration, and WebKitGTK defaults to enable it (so it will crash if you don't have OpenGL and you don't disable the acceleration). You can disable that either by exporting the environment variable WEBKIT_DISABLE_COMPOSITING_MODE=1 before running your program or by disabling the hardware-acceleration-policy setting when constructing the webview. Check: https://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html#WebKitSettings--hardware-acceleration-policy Note that if you disable the acceleration some things like CSS 3D transforms may work incorrectly. For example you will see a flat animation here: https://webkit.org/blog-files/3d-transforms/poster-circle.html Thank you for the links. The workaround you provide with setting WEBKIT_DISABLE_COMPOSITING_MODE=1 indeed avoids the coredump for me. Thank you! However, this leaves me with more questions :) Getting core dumps is not nice for users, and the setting is not easily guessable. So I assume applications should check more carefully before calling webkit-gtk, or set it up differently. Is there something I can tell the foliate developers to do to avoid the crash? As an example for a positive experience with webkit-gtk in the same environment: I have been using gnucash for many years, and gnucash embeds a HTML viewer using webkit-gtk. I have never had a crash in gnucash because of this problem. (In reply to Thomas Klausner from comment #2) > Thank you for the links. > > The workaround you provide with setting WEBKIT_DISABLE_COMPOSITING_MODE=1 > indeed avoids the coredump for me. Thank you! > > However, this leaves me with more questions :) > > Getting core dumps is not nice for users, and the setting is not easily > guessable. So I assume applications should check more carefully before > calling webkit-gtk, or set it up differently. Is there something I can tell > the foliate developers to do to avoid the crash? > Honestly, this its's kind of a corner-case. As of 2020 everyone running a Desktop should have some way of running OpenGL content. Even in your example (VNC) you can have OpenGL on it. Maybe that its not easy on NetBSD (no idea), but at least on GNU/Linux its easy to do thanks to Xvfb/Mesa/llvmpipe. BTW, also note that WebKitGTK has an option to disable OpenGL at build-time. If you do that you not longer need to disable it at run-time (it will always default to disable the hardware-acceleration codepaths). > As an example for a positive experience with webkit-gtk in the same > environment: I have been using gnucash for many years, and gnucash embeds a > HTML viewer using webkit-gtk. I have never had a crash in gnucash because of > this problem. Well, I was wrong before when I said that WebKitGTK defaults to enable hardware-acceleration. In reality it just defaults to set it as "on-demand". That means that it will not trigger the hardware-acceleration paths until some web-content requires it (like for example some Web content trying to use CSS 3D transforms). So I suspect that GNUCash works without trouble for you because the Web content rendered by GNUCash its simple enough that it doesn't trigger any hadware-acelerated codepaths in WebKitGTK. But, on your other example (foliate) some web-content its liekly triggering this codepath, and that causes a crash when WebKitGTK tries to enter into the hardware-accelerated mode to better render this content (but your system doesn't allow it to call into OpenGL). |