-
Notifications
You must be signed in to change notification settings - Fork 100
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
Richtext editor freezes Capella 7.0.0 on Linux #2879
Comments
I tried both workarounds with environment variables described in eclipse-platform/eclipse.platform.swt#843. Neither |
Hello I tried with Ubuntu 22.04.4 as windows11 sub system and I reproduced the issue. Nevertheless, I did not get completely freezes but get the Webkit time out of 10000ms. So to eliminate this additional context problem.
Those warning are about java call back that are called when doing things in the CKEditor
|
I reproduce the issue and the stack trace with ubuntu 24.04.4 in a virtualbox When the RichTextEditor initializes
There are two
In
This method fails. So something gets wrong in
Edit: It turns out
And then The executed script is : |
Hey @lfasani, thanks for the detailed investigation, appreciate it! The warnings ( I think that the JavaScript timeout is responsible for the freezes. It's interesting that you don't see the freezes in your installation (We have reproduced it on debian, fedora and ArchLinux). Maybe it's related to specific versions of other dependencies. But hard to figure out which dependency is responsible for it. I'll try to run Capella against webkit2gtk-4.1 instead of libwebkit2gtk-4.0-37 (Probably needs this commit eclipse-platform/eclipse.platform.swt@4d1d26a tho). |
Hello To complete the analysis in my previous comment, I tried to understand what was problematic in the script(I supposed for example that Otherwise, Capella is using |
Thanks for the clarification, then we are on the same line. My Capella is also usable again after 10 seconds, but I'd still consider that as not really usable if I have to wait 10 seconds after each keystroke. Some users have reported that newer commits in eclipse.platform.swt fixed the issue. Can we get a Capella build which includes the latest version of eclipse.platform.swt to try it out? As another workaround, is it maybe possible to reduce the timeout to a really low value to reduce the long freeze time? |
Reducing the timeout will get you nowhere. Because, under the hood, the problem is that the scripts are not executed and so the java callback that do the link between the Capella model and the CKEditor is broken. |
Hi Moritz, Eclipse Capella 7.0 is built on top of Eclipse 2023-03. I have just tried to launch the Nebula RichTextEditor sample from a fresh Eclipse 2024-06 on Ubuntu 22.04, I get the same initialization error. org.eclipse.swt.gtk.linux.aarch64_3.126.0.v20240528-0813.jar:
It contains the patch you mention. |
Thanks for trying out. Can you try the new version with the variables |
My test was done with and without those variables. |
Hi @mPorhel, can you share stdout/ stderr, please? |
The problem is independent from the classes defined in the The RichtextEditor widget in Capella fails, because the method The RichTextEditor tries that in this line 233: which in turn calls a Java method which is located in line 612 here: Whatever non-empty Javascript string we pass to One can demonstrate that wihout the Richtext widget:
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.BrowserFunction;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.events.SelectionEvent;
import java.io.File;
public class TestBrowser extends Composite {
Browser browser;
public static void main(String[] args) {
Display display = Display.getDefault();
Shell shell = new Shell(display, SWT.MIN | SWT.CLOSE);
shell.setText("SWT Browser test");
shell.setSize(500, 400);
shell.setLayout(new FillLayout());
TestBrowser testWindow = new TestBrowser(shell);
testWindow.createBrowser();
shell.open();
while (!display.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
}
int y = 0;
TestBrowser(Shell shell) {
super(shell, SWT.BORDER);
this.setSize(400, 400);
Button button = new Button(this, SWT.PUSH);
button.setText("Create a browser");
button.setLocation(200, 250);
button.pack();
button.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent arg0) {
}
@Override
public void widgetSelected(SelectionEvent arg0) {
createBrowser();
}
});
}
public void createBrowser() {
System.out.println("\nCreate a new browser");
browser = new Browser(this, SWT.BORDER);
browser.setSize(400, 200);
browser.setLocation(0, y);
File htmlFile;
htmlFile = new File("test.html");
browser.setUrl(htmlFile.getAbsolutePath());
final BrowserFunction brf = new JavaFunction(browser, "callJavaFunction");
y = y + 200;
}
private class JavaFunction extends BrowserFunction {
String name;
JavaFunction(Browser browser, String name) {
super(browser, name);
this.name = name;
}
@Override
public Object function(Object[] arguments) {
System.out.println("Java called from Javascript");
if (name.equals("callJavaFunction")) {
System.out.println("function callJava with argument : " + arguments[0]);
}
browser.evaluate("var a = 1;");
System.out.println("SUCCESS!");
return null;
}
}
}
<html>
<head>
<script type="text/javascript">
function hello(msg) {
try {
callJavaFunction(msg);
} catch (e) {
alert(e.message);
}
}
</script>
</head>
<body>
<h1>WebKit Version</h1>
<p id="userAgent"></p>
<script>
document.getElementById('userAgent').innerText = navigator.userAgent;
</script>
<a href="javascript:hello('link clicked')">click here</a>
</body>
</html> This code executes just fine and opens the following window in a Fedora Docker container on an aarch64 macOS: When one clicks on the link labelled as "click here", we get (after waiting the 10 seconds) the same timeout message: |
The same isolated SWT browser code which tries to execute some Javascript runs without a failure/ timeout on macOS (aarch64): In both cases (Linux and macOS) I have put the SWT libs from capella/plugins of the Capella 7.0.0-S20240619 downloads (
and
|
Hi @jamilraichouni, I got the same errors/stacks than Laurent, Moritz and you. |
I have run your TestBrowser snippet with eclipse-committers-2024-06-R-linux-gtk-aarch6 with org.eclipse.swt_3.126.0.v20240528-0813.jar and org.eclipse.swt.gtk.linux.aarch64_3.126.0.v20240528-0813.jar I get exactly the same behavior/logs than you with Capella 7 (Eclipse 2023-03). |
In parallel to the discussion in the Eclipse/Webkit browser issue, I am testing a second approach to avoid the observed deadlock with a few workraounds directly inside Capella/Kitalpha's Richtext configuration, functions and helpers for the Webkit/gtk case. I currently have some interesting results. |
In the latest pre-release of Capella 7.0.0, the description editor / richtext editor is completely unusable. Whenever I start typing, Capella freezes completely.
Steps to reproduce
I can also provide a Docker image to reproduce. Let me know if that would help.
Stacktrace
I've tried several different webkit2gtk versions, also different distributions (Alpine, Fedora & Debian). I could reproduce the issue in all cases.
The issue seems to be different to the other reported issues affecting Capella versions < 7.0.0 on Linux: #2316
The text was updated successfully, but these errors were encountered: