-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eclipse/Webkit browser crashes on Linux #843
Comments
Do you say it works with Wayland for you? |
I've now tested it with Wayland on Ubuntu and it works. But not working with X11. I can't test Wayland on Linux Mint because that distro only supports X11.
On Ubuntu I see these versions:
|
And which webkit is loaded by SWT? |
You would have to be more specific as these are the so names (more or less) but the actual webkitgtk versions are 2.xx.x format (https://webkitgtk.org/) and I'm interested to see whether you have newer or older version (mine is 2.42.1). eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h Line 48 in 459dadd
|
How do I get the specific versions? |
Go to Eclipse about dialog, software configuration, type SWT and get list of variables set by the framework. |
This is my Debian knowledge maximum - smth like |
Sorry, can't see any libwebkit2gtk info there. |
OK: Ubuntu:
Linux Mint:
|
So same version (difference could come from distro patches still). Please try getting rid of libwebkit2gtk-4.0-37 for the sake of the experiment. |
You might be hitting https://bugzilla.redhat.com/show_bug.cgi?id=2240428 but I have no idea about debian/ubuntu GL/GLES naming to give you some more hints. |
Didn't fix it. I rolled back to a snapshot of my Linux Mint installation that uses version 2.40.5 of |
More investigations using Linux Mint (non-Wayland), webkitgtk 2.42.1. Using this snippet: import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class BrowserTest {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setText("Browser Test");
shell.setLayout(new GridLayout());
Browser browser = new Browser(shell, SWT.NONE);
browser.setLayoutData(new GridData(GridData.FILL_BOTH));
Button button = new Button(shell, SWT.PUSH);
button.setText("Go");
button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
button.addListener(SWT.Selection, event -> {
browser.setUrl("https://www.eclipse.org");
});
shell.setSize(900, 700);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
} Sometimes some of the website is rendered in the browser component but most times it is blank. Hovering the mouse over the window the cursor changes to indicate links. Pressing a (invisible) link or pressing the "Go" button a second time gives the following error after some time:
|
I've got to google on the issue again A workaround is to use the environment variable WEBKIT_DISABLE_COMPOSITING_MODE=1 Since it seems to be about compositing i'm not sure it affects certain 'X' servers, or graphics drivers or even desktop environment But I was affected with either Xorg or wayland, with kde plasma, gnome and enlightenment on Arch Linux with propietary nvidia 470xx drivers UPDATE: The environment variable |
@dabicho Thanks for the workaround, which is working for me on Linux Mint (X11). Do you know if this is something that will be fixed in webkitgtk? |
WEBKIT_DISABLE_DMABUF_RENDERER=1 fixed my problem on Ubuntu 22.04.3 LTS, X11 |
Thanks @dabicho for the workaround, just for the record: libwebkit2gtk-4.0-37:amd64 2.38.6-0ubuntu0.20.04.1 |
@froshyfrosh It would be nice if you can install libwebkit2gtk-4.1 and try with today's I-build(https://download.eclipse.org/eclipse/downloads/drops4/I20240111-0700/) that contains 4d1d26a . |
We see also some webkit crashes on RHEL 7.9 but with different stack...
I'm curious where do you find all the |
@akurtakov Ok, I can try that next week. Today I'm working from home via xrdp on that machine and I just realized that this way it works even without any of those env. vars. |
@akurtakov Sorry I forgot to check last time I was in the office. Today I did it, but I cannot reproduce it any more. Javadoc view and tooltips are working now without any environment variables set. I'm not aware of any changes/updates on this machine. Only a reboot (but I think I did that before and there it did not help then). If you want me to check something let me know. |
@Phillipus do you still face this issue? TBH, I lost track here but that's what happens when multiple reports end up in same issue thus I'm pointing to you as the one that opened it. |
@Phillipus do you still face this issue? Yes. I'm testing on two Linux VMs - Ubuntu 23.04 and Linux Mint 21.3 (Ubuntu 22.04 base). These have latest package updates. Running Ubuntu 23.04
Linux Mint 21.3
Note this is X11, not Wayland. The following workaround is still working:
|
Having the issue where opening various eclipse screens (the help contents and hover javadocs the most prominent) crashes it. Trying to install a fresh eclipse also resulted in the installer crashing.
|
If you are running your Linux OS in a Virtual Environment (VMWare/VirtualBox), try disabling 3d Acceleration. VBox: We ran across this problem with another application, managed to work around it by doing the above. |
|
Would you please try with https://download.eclipse.org/eclipse/downloads/drops4/I20240329-0530/ ? It should have a workaround for the problem. |
Added note for Linux users about crash reporting/webkit See #843
Added note for Linux users about crash reporting/webkit See #843
Added note for Linux users about crash reporting/webkit See eclipse-platform#843
In Eclipse Capella, the same issue appears with the description editor, which uses the internal browser too. It makes the Eclipse completely unusable since the whole application freezes completely after a few seconds when the browser opens. The stack trace is the same:
|
Hate to bring bad news here, but webkit-gtk 2.44.1 produces crashes whenever a JSDoc pop-up should be displayed on Wayland 1.22 (GTK+ 3.24.41). |
Same situation with Eclipse 2024-06 and RichTextEditorSample from Nebula (master) on Ubuntu 22.04 and 24.04 (libwebkit2gtk-4.1-0:amd64 2.44.2-0ubuntu0.24.04.1 , ibgtk-3-0t64:amd64 3.24.41-4ubuntu1) Eclipse Capella (7.0) is based on Eclipse 2023-03 with several customizations. But the issue can be reproduced with recent version of SWT, Eclipse, Nebula without the customization done by Capella and Kitalpha.
|
The Javascript code evaluation times out on Linux. It can easily be reproduced by spawning a Browser and asking it to evaluate some Javascript code. |
Hi @akurtakov , the SWT browser times out when one tries to pass any Javascript code to the Line 993 in d95a444
The problematic line is in Line 1033 in d95a444
When I modify this code and force a non blocking call like the following, it does not time out anymore but I'm afraid that it breaks the Java / Javascript bridge: I have Does that help? How do I check, if I really use this webkit lib my system package manager lists as installed? I ask, because I see Does my template HTML I used in my debug code (next link) work to show the Webkit version? It is irritating that it shows the same version for my macOS host and Fedora Docker container although it works on the host and times out in the Fedora container. I'd appreciate if you could read what I describe here: eclipse-capella/capella#2879 (comment) |
The *.so files in the jar are actually jni binding that call into the actual webkit2gtk libs you have installed on your system.
The version of webkit can be the same on mac and linux but you'll be using different ports (cocoa vs gtk) much like same Eclipse version on mac and linux will used completely different swt implementations (cocoa vs gtk) - and this comes with different bugs and/or features.
I have reproduced the issue on my side but unfortunately don't have the time to spend to investigate it more now. You would have to dig what happens on your on and if/when you have a PR ready I'll happily review it. |
Okay, thanks @akurtakov ! I am not a Java developer, but I research a bit. For others: There is no timeout, when Java code lets the browser evaluate Javascript, but we have the timeout issue (deadlock), when Javascript calls a Java function which in turn asks the browser to execute Javascript. |
What I described in my previous comment seems to be in line with what one can read in the first comment of this bug report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=512001 The bug is referenced multiple times in bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java |
Hi @jamilraichouni @akurtakov, In the situation where we get the timeout stack as reported by Jamil, the Javascript alert is shown so the Javascript is executed but the return value never obtained : org.eclipse.swt.browser.WebKit.Webkit2AsyncToSync.runjavascript_callback(long, long, long) is not called in those cases.
WebKitGTK.webkit_web_view_run_javascript calls stacks
I have also noticed that Webkit 2.40 the API used in org.eclipse.swt.browser.WebKit.Webkit2AsyncToSync::runjavascript/execAsyncAndWaitForReturn have been marked as deprecated: 2 methods linked via org.eclipse.swt.internal.webkit.WebKitGTK might need to be adapted:
I wonder if/how we might try to use the replacement methods to see if WebKit behavior has changed. I checked the behavior on macOs, both scenarios from the sample behave well, in the same way using the org.eclipse.swt.browser.WebBrowser::evaluate/nonBlockingExecute methods. The Java callback is well called in both cases. |
Feel free to provide a patch for testing that, contribution is welcome. |
Describe the bug
The internal Browser is not rendering on Linux.
To Reproduce
Install latest Eclipse on Ubuntu 23.04 (X11 not Wayland) or Linux Mint 21.2 and do one of the following:
Either the browser is blank, or sometimes using the Internal Browser View in Eclipse you might see a little of the content. It also seems to be hanging because there is a long delay closing Eclipse.
Expected behavior
Browser component should render on Linux.
Environment:
Ubuntu 23.04
GTK 3.24.37
or:
Linux Mint 21.2
GTK 3.24.33
Temurin-17.0.8+7 (build 17.0.8+7)
Version since
Tested on Eclipse 4.27 and later
Workaround (or) Additional context
None
The text was updated successfully, but these errors were encountered: