Bug 238844 - www/webkit2-gtk3: 2.24.0 is buggy and breaks eclipse
Summary: www/webkit2-gtk3: 2.24.0 is buggy and breaks eclipse
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-gnome mailing list
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2019-06-27 11:19 UTC by Patrick Mackinlay
Modified: 2019-08-08 13:10 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (gnome)
koobs: merge-quarterly?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Mackinlay 2019-06-27 11:19:11 UTC
The current version of www/webkit2-gtk3, 2.24.0, is buggy and breaks eclipse (many versions including eclipse-4.11). Downgrading version to 2.22.6 fixes this issue.

The issue with eclipse is that the application continuously blocks for 10 seconds (tooltips fail, autocompletion fails ...). The problem is reported in the logs as follows:

SWT call to Webkit timed out after 10000ms. No return value will be provided.
Possible reasons:
1) Problem: Your javascript needs more than 10000ms to execute.
   Solution: Don't run such javascript, it blocks Eclipse's UI. SWT currently allows such code to complete, but this error is thrown 
     and the return value of execute()/evalute() will be false/null.

2) However, if you believe that your application should execute as expected (in under10000 ms),
 then it might be a deadlock in SWT/Browser/webkit2 logic.
 I.e, it might be a bug in SWT (e.g this does not occur on Windows/Cocoa, but occurs on Linux). If you believe it to be a bug in SWT, then
Please report this issue *with steps to reproduce* via:
 https://bugs.eclipse.org/bugs/enter_bug.cgi?alias=&assigned_to=platform-swt-inbox%40eclipse.org&attach_text=&blocked=&bug_file_loc=http%3A%2F%2F&bug_severity=normal&bug_status=NEW&comment=&component=SWT&contenttypeentry=&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&data=&defined_groups=1&dependson=&description=&flag_type-1=X&flag_type-11=X&flag_type-12=X&flag_type-13=X&flag_type-14=X&flag_type-15=X&flag_type-16=X&flag_type-2=X&flag_type-4=X&flag_type-6=X&flag_type-7=X&flag_type-8=X&form_name=enter_bug&keywords=&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=Linux&product=Platform&qa_contact=&rep_platform=PC&requestee_type-1=&requestee_type-2=&short_desc=webkit2_BrowserProblem
For bug report, please atatch this stack trace:
java.lang.Throwable: 
        at org.eclipse.swt.browser.WebKit.getStackTrace(WebKit.java:489)
        at org.eclipse.swt.browser.WebKit.getInternalErrorMsg(WebKit.java:482)
        at org.eclipse.swt.browser.WebKit.access$1(WebKit.java:472)
        at org.eclipse.swt.browser.WebKit$Webkit2AsyncToSync.execAsyncAndWaitForReturn(WebKit.java:1907)
        at org.eclipse.swt.browser.WebKit$Webkit2AsyncToSync.runjavascript(WebKit.java:1796)
        at org.eclipse.swt.browser.WebKit$Webkit2AsyncToSync.evaluate(WebKit.java:1744)
        at org.eclipse.swt.browser.WebKit.evaluate(WebKit.java:1930)
        at org.eclipse.swt.browser.WebKit.close(WebKit.java:1551)
        at org.eclipse.swt.browser.WebKit.onDispose(WebKit.java:2563)
        at org.eclipse.swt.browser.WebKit.lambda$4(WebKit.java:1312)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5783)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1411)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1437)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1416)
        at org.eclipse.swt.widgets.Widget.release(Widget.java:1228)
        at org.eclipse.swt.widgets.Control.release(Control.java:4570)
        at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:1489)
        at org.eclipse.swt.widgets.Widget.release(Widget.java:1231)
        at org.eclipse.swt.widgets.Control.release(Control.java:4570)
        at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:1489)
        at org.eclipse.swt.widgets.Canvas.releaseChildren(Canvas.java:279)
        at org.eclipse.swt.widgets.Decorations.releaseChildren(Decorations.java:486)
        at org.eclipse.swt.widgets.Shell.releaseChildren(Shell.java:3128)
        at org.eclipse.swt.widgets.Widget.release(Widget.java:1231)
        at org.eclipse.swt.widgets.Control.release(Control.java:4570)
        at org.eclipse.swt.widgets.Widget.dispose(Widget.java:526)
        at org.eclipse.swt.widgets.Shell.dispose(Shell.java:3051)
        at org.eclipse.jface.text.AbstractInformationControl.dispose(AbstractInformationControl.java:506)
        at org.eclipse.jface.text.AbstractInformationControlManager.disposeInformationControl(AbstractInformationControlManager.java:1278)
        at org.eclipse.jface.text.contentassist.AdditionalInfoController.disposeInformationControl(AdditionalInfoController.java:498)
        at org.eclipse.jface.text.AbstractInformationControlManager.handleSubjectControlDisposed(AbstractInformationControlManager.java:647)
        at org.eclipse.jface.text.AbstractInformationControlManager.lambda$0(AbstractInformationControlManager.java:682)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:127)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5783)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1411)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1437)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1416)
        at org.eclipse.swt.widgets.Widget.release(Widget.java:1228)
        at org.eclipse.swt.widgets.Control.release(Control.java:4570)
        at org.eclipse.swt.widgets.Widget.dispose(Widget.java:526)
        at org.eclipse.swt.widgets.Shell.dispose(Shell.java:3051)
        at org.eclipse.jface.text.contentassist.CompletionProposalPopup.hide(CompletionProposalPopup.java:1104)
        at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:957)
        at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:1384)
        at org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:809)
        at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:480)
        at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:70)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5783)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1411)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1437)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1420)
        at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1196)
        at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:6083)
        at org.eclipse.swt.custom.StyledText.lambda$1(StyledText.java:5786)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5783)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1411)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1437)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1420)
        at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1461)
        at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:817)
        at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:3935)
        at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:857)
        at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2203)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:6764)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:6035)
        at org.eclipse.swt.internal.gtk.GTK._gtk_main_do_event(Native Method)
        at org.eclipse.swt.internal.gtk.GTK.gtk_main_do_event(GTK.java:4135)
        at org.eclipse.swt.widgets.Display.eventProc(Display.java:1407)
        at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
        at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1584)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4577)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
        at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:566)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:661)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1476)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1449)

 Additional information about the error is as following:
 The following javascript was executed:
function SWTWebkit2TempFunc3(){return SWTExecuteTemporaryFunctionCLOSE(window);}; SWTWebkit2TempFunc3()
Comment 1 Michael Zhilin 2019-08-01 06:59:16 UTC
I'm using 2.24.0 and I see freezes from time to time. But I don't see it frequently. So it will be nice to have reproducible step-by-step.

Just for information, here is java stack of hang (my case, also javascript and webkit2):
"main" #1 prio=6 os_prio=15 tid=0x0000000801ba2000 nid=0x18a9e runnable [0x00007fffdfff9000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1584)
	at org.eclipse.swt.browser.WebKit$Webkit2AsyncToSync.execAsyncAndWaitForReturn(WebKit.java:1894)
	at org.eclipse.swt.browser.WebKit$Webkit2AsyncToSync.runjavascript(WebKit.java:1796)
	at org.eclipse.swt.browser.WebKit$Webkit2AsyncToSync.evaluate(WebKit.java:1744)
	at org.eclipse.swt.browser.WebKit.evaluate(WebKit.java:1930)
	at org.eclipse.swt.browser.WebKit.close(WebKit.java:1551)
	at org.eclipse.swt.browser.WebKit.onDispose(WebKit.java:2563)
	at org.eclipse.swt.browser.WebKit.lambda$4(WebKit.java:1312)
	at org.eclipse.swt.browser.WebKit$$Lambda$535/1028788718.handleEvent(Unknown Source)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5783)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1411)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1437)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1416)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:1228)
	at org.eclipse.swt.widgets.Control.release(Control.java:4570)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:1489)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:1231)
	at org.eclipse.swt.widgets.Control.release(Control.java:4570)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:1489)
	at org.eclipse.swt.widgets.Canvas.releaseChildren(Canvas.java:279)
	at org.eclipse.swt.widgets.Decorations.releaseChildren(Decorations.java:486)
	at org.eclipse.swt.widgets.Shell.releaseChildren(Shell.java:3128)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:1231)
	at org.eclipse.swt.widgets.Control.release(Control.java:4570)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:526)
	at org.eclipse.swt.widgets.Shell.dispose(Shell.java:3051)
	at org.eclipse.jface.text.AbstractInformationControl.dispose(AbstractInformationControl.java:506)
	at org.eclipse.jface.text.AbstractInformationControlManager.disposeInformationControl(AbstractInformationControlManager.java:1278)
	at org.eclipse.jface.text.AbstractInformationControlManager.dispose(AbstractInformationControlManager.java:1293)
	at org.eclipse.jface.text.AbstractHoverInformationControlManager.dispose(AbstractHoverInformationControlManager.java:919)
	at org.eclipse.jface.text.TextViewerHoverManager.dispose(TextViewerHoverManager.java:381)
	at org.eclipse.jface.text.TextViewer.handleDispose(TextViewer.java:1861)
	at org.eclipse.jface.text.source.SourceViewer.handleDispose(SourceViewer.java:791)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.handleDispose(ProjectionViewer.java:1296)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.handleDispose(JavaSourceViewer.java:512)
	at org.eclipse.jface.text.TextViewer.lambda$1(TextViewer.java:1722)
	at org.eclipse.jface.text.TextViewer$$Lambda$367/863768292.widgetDisposed(Unknown Source)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:127)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5783)
Comment 2 Patrick Mackinlay 2019-08-01 09:39:44 UTC
To find a easily reproducible scenario, I tried a bran new install, I removed my ports compiled versions of webkit2-gtk3 and eclipse, then ran a `pkg install eclipse`. It installed eclipse-4.11 and webkit2-gtk3-2.24.0_1. Before starting I removed my .eclipse directory and my workspace. 

To reproduce, 
 1. Start eclipse (in a terminal) with an empty workspace.
 2. Close the welcome panel.
 3. Create a new java 1.8 java project, TestProject (File->New->Java Project).
 4. Create a new java class, Test.java (File->New->Class).
 5. Create a new toString() method in the Test class using autocomplete (Position the mouse cursor in the body of the test class, type "to" and press CTRL-SPACE, select the toString option, but then do nothing else)
 6. Eclipse should then add an empty toString method almost immediately, however after 10 seconds the exception will occur (will appear in your terminal window).

Note that this scenario will trigger the bug, but the GUI thread will not block and so the bug appears fairly benign. In my normal use, where I am using autocomplete continusouly (to complete variable names, method names, classes etc.) the GUI thread eventually blocks and eclipse becomes unusable. You can try deleting the toString() method and doing it again, the second time round appears worse. If you try to create toString(), then equals() and then hashCode() methods relatively quickly one after another, using autocomplete after the first two letters, you will probably block your GUI thread, or at the very least it will fail to autocomplete.
Comment 3 Michael Zhilin 2019-08-01 12:02:14 UTC
Thank you! I've reproduced it on 2.24.0 and 2.24.3.
Changes of 2.24.0 look fine, except one: "Script dialogs are now modal to the current web view only". I guess it can correlate with actual issue.

I wonder if Eclipse has similar issue on Linux platform.
Comment 4 Patrick Mackinlay 2019-08-01 13:03:45 UTC
I have an arch linux box, I just installed eclipse and it doesn't appear to have this issue. However, arch's package manager is running eclipse 4.12. This is what it installed:

eclipse-common 4.12-1
eclipse-java 4.12-1
webkit2gtk 2.24.3-1
Comment 5 Michael Zhilin 2019-08-01 13:05:25 UTC
Can you try eclipse 4.11 from official website?
https://www.eclipse.org/downloads/packages/release/2019-03/r/eclipse-ide-java-developers
Comment 6 Patrick Mackinlay 2019-08-01 13:28:18 UTC
I removed the packages
eclipse-common 4.12-1
eclipse-java 4.12-1
and tried the eclipse in the tar ball and it too works fine!

The about box reports:
Version: 2019-03 (4.11.0)
Build id: 20190314-1200
Comment 7 Michael Zhilin 2019-08-08 13:10:37 UTC
Still buggy. Is it time to call for help at emailing lists (current or ports)?