Bug 404776 - crash: fatal error in soup_session_feature_detach with WebKitGTK+ >= 1.11.91
crash: fatal error in soup_session_feature_detach with WebKitGTK+ >= 1.11.91
Status: RESOLVED FIXED
Product: Platform
Classification: Eclipse
Component: SWT
4.2
PC Linux-GTK
: P3 normal with 1 vote (vote)
: 4.3 M7
Assigned To: Grant Gayed CLA Friend
:
: 405786 406736 407076 407208 408680 411745 411948 417037 417542 426031 434588 439082 440571 442630 443457 454196 (view as bug list)
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2013-04-03 03:35 EDT by Jakub Adam CLA Friend
Modified: 2014-12-05 02:29 EST (History)
33 users (show)

See Also:


Attachments
Patch for the crash (1.26 KB, patch)
2013-04-03 03:35 EDT, Jakub Adam CLA Friend
no flags Details | Diff
Example crash report (114.71 KB, text/x-log)
2013-04-03 03:36 EDT, Jakub Adam CLA Friend
no flags Details
Patch for the crash (1.26 KB, patch)
2013-04-03 03:37 EDT, Jakub Adam CLA Friend
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Adam CLA Friend 2013-04-03 03:35:18 EDT
Created attachment 229266 [details]
Patch for the crash

With recent versions of WebKitGTK+, Eclipse crashes whenever Javadoc hover help is to be displayed in Java editor.

Looks this happens because WebKit doesn't attach a default Authenticate listener and therefore WebKitGTK.soup_session_get_feature() returns 0 in WebKit.create(). See attached patch for fix.

Reproduced with all 3.8, 4.2 and 4.3 versions of SWT.
Comment 1 Jakub Adam CLA Friend 2013-04-03 03:36:54 EDT
Created attachment 229267 [details]
Example crash report
Comment 2 Jakub Adam CLA Friend 2013-04-03 03:37:55 EDT
Created attachment 229268 [details]
Patch for the crash
Comment 3 Grant Gayed CLA Friend 2013-04-03 09:59:38 EDT
Thanks for investigating this Jakub, targeting for 4.3.  From the crash report:

Stack: [0x00007f3e62e0d000,0x00007f3e62f0e000],  sp=0x00007f3e62f0b3a0,  free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libsoup-2.4.so.1+0x72d59]  soup_session_feature_detach+0x19

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.eclipse.swt.internal.webkit.WebKitGTK._soup_session_feature_detach(JJ)V+0
j  org.eclipse.swt.internal.webkit.WebKitGTK.soup_session_feature_detach(JJ)V+9
j  org.eclipse.swt.browser.WebKit.create(Lorg/eclipse/swt/widgets/Composite;I)V+919
j  org.eclipse.swt.browser.Browser.<init>(Lorg/eclipse/swt/widgets/Composite;I)V+81
j  org.eclipse.jface.internal.text.html.BrowserInformationControl.isAvailable(Lorg/eclipse/swt/widgets/Composite;)Z+12
j  org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover$HoverControlCreator.doCreateInformationControl(Lorg/eclipse/swt/widgets/Shell;)Lorg/eclipse/jface/text/IInformationControl;+18
j  org.eclipse.jface.text.AbstractReusableInformationControlCreator.createInformationControl(Lorg/eclipse/swt/widgets/Shell;)Lorg/eclipse/jface/text/IInformationControl;+20
j  org.eclipse.jface.text.AbstractInformationControlManager.getInformationControl()Lorg/eclipse/jface/text/IInformationControl;+176
j  org.eclipse.jface.text.AbstractInformationControlManager.internalShowInformationControl(Lorg/eclipse/swt/graphics/Rectangle;Ljava/lang/Object;)V+18
j  org.eclipse.jface.text.AbstractInformationControlManager.presentInformation()V+70
j  org.eclipse.jface.text.AbstractHoverInformationControlManager.presentInformation()V+64
j  org.eclipse.jface.text.TextViewerHoverManager.doPresentInformation()V+1
j  org.eclipse.jface.text.TextViewerHoverManager$5.run()V+4
j  org.eclipse.swt.widgets.RunnableLock.run()V+11
j  org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Z)Z+29
j  org.eclipse.swt.widgets.Display.runAsyncMessages(Z)Z+5
j  org.eclipse.swt.widgets.Display.readAndDispatch()Z+61
j  org.eclipse.ui.internal.Workbench.runEventLoop(Lorg/eclipse/jface/window/Window
Comment 4 Grant Gayed CLA Friend 2013-04-16 16:39:23 EDT
*** Bug 405786 has been marked as a duplicate of this bug. ***
Comment 5 Alexander Kurtakov CLA Friend 2013-04-19 04:54:45 EDT
Grant,
Any plans to accept the patch soon? It is impossible to launch Kepler builds on Fedora 19 because of this.
Comment 6 Ismail Dönmez CLA Friend 2013-04-19 04:55:34 EDT
For a workaround add the following to the end of your eclipse.ini

-Dorg.eclipse.swt.browser.DefaultType=mozilla
Comment 7 Alexander Kurtakov CLA Friend 2013-04-19 05:02:51 EDT
(In reply to comment #6)
> For a workaround add the following to the end of your eclipse.ini
> 
> -Dorg.eclipse.swt.browser.DefaultType=mozilla

Mozilla is even less reliable as it breaks with every firefox update ans SWT doesn't support recent xulrunner versions (20.0 here) -at least it wasn't last I checked.
Comment 8 Ismail Dönmez CLA Friend 2013-04-19 05:04:22 EDT
Works for me on openSUSE 12.3
Comment 9 René Krell CLA Friend 2013-04-19 06:13:36 EDT
In which environment, the same one with GNOME 3.8 (separate repository GNOME:STABLE) using libsoup 2.42.0? See also bug 405786.
Also in this report there was said "with recent versions of WebkitGTK+" (which is not a standard OpenSUSE 12.3)

(In reply to comment #8)
> Works for me on openSUSE 12.3
Comment 10 Ismail Dönmez CLA Friend 2013-04-19 06:14:22 EDT
Ah I am using GNOME:Stable:3.8 repo.
Comment 11 René Krell CLA Friend 2013-04-19 06:38:25 EDT
(In reply to comment #10)
> Ah I am using GNOME:Stable:3.8 repo.

I use apparently (almost) the same environment OpenSUSE 12.3 + GNOME:Stable:3.8 and it crashes. Before updating to GNOME:Stable:3.8 it didn't crash for several weeks of intensive work with Eclipse. Therefore I'd rather ask:
- You don't override -Dorg.eclipse.swt.browser.DefaultType in eclipse.ini?
- Did you try the Javadoc hovers in some open Java editor for a while?
Comment 12 Ismail Dönmez CLA Friend 2013-04-19 06:40:48 EDT
(In reply to comment #11)
> (In reply to comment #10)
> > Ah I am using GNOME:Stable:3.8 repo.
> 
> I use apparently (almost) the same environment OpenSUSE 12.3 +
> GNOME:Stable:3.8 and it crashes. Before updating to GNOME:Stable:3.8 it
> didn't crash for several weeks of intensive work with Eclipse. Therefore I'd
> rather ask:
> - You don't override -Dorg.eclipse.swt.browser.DefaultType in eclipse.ini?
> - Did you try the Javadoc hovers in some open Java editor for a while?


1. I have -Dorg.eclipse.swt.browser.DefaultType=mozilla in my eclipse.ini
2. Yes I did, I opened an Android project and checked docs for multiple functions. Works fine.
Comment 13 René Krell CLA Friend 2013-04-19 06:43:49 EDT
Oh Ismail, sorry, I think I got the message after I've noticed your comments above. You tried the workaround, not the standard Eclipse.
The workaround with the "mozilla" default type works for me, too, using Firefox 20 (xulrunner-17.0.5-2.1.x86_64).

(In reply to comment #11)
> (In reply to comment #10)
> > Ah I am using GNOME:Stable:3.8 repo.
> 
> I use apparently (almost) the same environment OpenSUSE 12.3 +
> GNOME:Stable:3.8 and it crashes. Before updating to GNOME:Stable:3.8 it
> didn't crash for several weeks of intensive work with Eclipse. Therefore I'd
> rather ask:
> - You don't override -Dorg.eclipse.swt.browser.DefaultType in eclipse.ini?
> - Did you try the Javadoc hovers in some open Java editor for a while?
Comment 14 Grant Gayed CLA Friend 2013-04-19 16:41:17 EDT
(In reply to comment #5)
> Any plans to accept the patch soon? It is impossible to launch Kepler builds
> on Fedora 19 because of this.

A fix will be in for 4.3M7.  I don't have a built WebKitGTK 2.0 to use yet, and I want to do a good test pass with it.
Comment 15 Grant Gayed CLA Friend 2013-04-25 15:04:38 EDT
Fixed > 20130425, commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=b22a7d19afbe2a3811a0f8aa54c1e85d92c62a2c .

Logged bug 406605 for new problem with the WebKitGTK 2.0 default authentication prompter.
Comment 16 Paul Webster CLA Friend 2013-04-27 14:50:24 EDT
*** Bug 406736 has been marked as a duplicate of this bug. ***
Comment 17 Dani Megert CLA Friend 2013-05-03 03:31:56 EDT
*** Bug 407076 has been marked as a duplicate of this bug. ***
Comment 18 Grant Gayed CLA Friend 2013-05-07 12:56:30 EDT
*** Bug 407208 has been marked as a duplicate of this bug. ***
Comment 19 Sascha Baumeister CLA Friend 2013-05-07 15:47:48 EDT
Just wanted you to know that adding the line to eclipse.ini seems to work for me under Ubuntu Gnome 13.04, upgraded to Gnome 3.8.1. Will the fix be part of this summer's Juno successor?

If not, I think the workaround info needs somehow to be spread, because this bug renders Eclipse totally unusable on newer Gnome-based linux distros, and this entry seems somewhat hard to find using google ... I didn't, which is the reason I created the duplicate, and I fear I won't have been the last.
Comment 20 Grant Gayed CLA Friend 2013-05-07 16:09:27 EDT
(In reply to comment #19)
> Will the fix be part of this summer's Juno successor?

Yes, it will be in the June 4.3 release.
Comment 21 Jose Luis Moya Sobrado CLA Friend 2013-05-11 13:08:20 EDT
The workaround didn't do it for me as eclipse 4.2.2 continues to crash.  Does anyone have any other suggestion as to how to fix the problem? Would anyone be kind enough to explain how to apply the patch attached?
Comment 22 Grant Gayed CLA Friend 2013-05-21 10:55:38 EDT
(In reply to comment #21)

To work around this with 4.2.2 you need to add two lines to the end of your eclipse.ini:

1. the line in comment 6
2. -Dorg.eclipse.swt.browser.XULRunnerPath=<path> where <path> is the full path to a downloaded XULRunner to use (XULRunner 10 is suggested since it's the latest supported release).  If for some reason this does not work then you can substitute an invalid path for <path> (eg.- "/dev/null"), which will run with no browser support (base eclipse runs generally fine without browser support).
Comment 23 Paul Webster CLA Friend 2013-05-22 08:56:41 EDT
*** Bug 408680 has been marked as a duplicate of this bug. ***
Comment 24 Paul Webster CLA Friend 2013-06-27 09:25:21 EDT
*** Bug 411745 has been marked as a duplicate of this bug. ***
Comment 25 Markus Keller CLA Friend 2013-07-04 11:55:59 EDT
*** Bug 411948 has been marked as a duplicate of this bug. ***
Comment 26 Thomas Rørvik Skjølberg CLA Friend 2013-07-10 17:23:50 EDT
Using this workaround with fedora 19 removes the crash but displays an empty information window for autocompletes (for ctrl-space); unusable.

-Dorg.eclipse.swt.browser.DefaultType=mozilla
-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib64/xulrunner/
Comment 27 Alexander Kurtakov CLA Friend 2013-07-11 01:34:11 EDT
(In reply to comment #26)
> Using this workaround with fedora 19 removes the crash but displays an empty
> information window for autocompletes (for ctrl-space); unusable.
> 
> -Dorg.eclipse.swt.browser.DefaultType=mozilla
> -Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib64/xulrunner/

Thomas, do you see this problem with 4.3 final? I don't see the crash with both Eclipse from Fedora(yum install eclipse) and downloaded one from Eclipse.org. Fedora ships with xulrunner 22 which is not supported by swt.
Comment 28 Thomas Rørvik Skjølberg CLA Friend 2013-07-12 17:29:56 EDT
Upgrading to 4.3 works perfectly, thanks.
Comment 29 Michal Politowski CLA Friend 2013-08-28 08:39:51 EDT
The workaround seems to work on Indigo with xulrunner 17.
Comment 30 Paul Webster CLA Friend 2013-09-11 15:57:33 EDT
*** Bug 417037 has been marked as a duplicate of this bug. ***
Comment 31 Paul Webster CLA Friend 2013-09-18 16:42:55 EDT
*** Bug 417542 has been marked as a duplicate of this bug. ***
Comment 32 Dan Winship CLA Friend 2013-10-16 13:05:10 EDT
Comment on attachment 229268 [details]
Patch for the crash

> 	long /*int*/ originalAuth = WebKitGTK.soup_session_get_feature (session, WebKitGTK.webkit_soup_auth_dialog_get_type ());
>-	WebKitGTK.soup_session_feature_detach (originalAuth, session);
>+	if (originalAuth != 0) {
>+		WebKitGTK.soup_session_feature_detach (originalAuth, session);
>+	}
> 	OS.g_signal_connect (session, WebKitGTK.authenticate, Proc5.getAddress (), webView);
>-	WebKitGTK.soup_session_feature_attach (originalAuth, session);
>+	if (originalAuth != 0) {
>+		WebKitGTK.soup_session_feature_attach (originalAuth, session);
>+	}

FWIW, the lookup/detach/attach code there is completely unnecessary anyway... The only line here that actually does anything is the g_signal_connect() line.
Comment 33 Jeremiah Renfro CLA Friend 2013-11-22 19:23:01 EST
FWIW I found this thread because I was getting a similar crash after updating OpenSUSE to 13.1 and eclipse to Kepler (eclipse.buildId=4.3.0.M20130911-1000)

Here is the tail of the console log: 

No bp log location saved, using default.
[000:000] Browser XEmbed support present: 1
[000:001] Browser toolkit is Gtk2.
[000:001] Using Gtk2 toolkit
No bp log location saved, using default.

Adding -Dorg.eclipse.swt.browser.DefaultType=mozilla to eclipse.ini seems to have resolved the problem... for now. I only think it is worth mentioning because this was supposedly resolved in 4.3
Comment 34 Grant Gayed CLA Friend 2013-11-25 10:13:46 EST
(In reply to Jeremiah Renfro from comment #33)

Are you sure you're seeing the same crash (the dump file from your JRE indicates that it's in the soup_session_feature_detach() call)?  The fix for this was a simple null check, and I haven't heard of anyone else seeing it since the fix went in.  Maybe you're seeing bug 400626?
Comment 35 Jeremiah Renfro CLA Friend 2013-11-25 13:17:48 EST
(In reply to Grant Gayed from comment #34)
> (In reply to Jeremiah Renfro from comment #33)
> 
> Are you sure you're seeing the same crash (the dump file from your JRE
> indicates that it's in the soup_session_feature_detach() call)?  The fix for
> this was a simple null check, and I haven't heard of anyone else seeing it
> since the fix went in.  Maybe you're seeing bug 400626?

Maybe I am experiencing 400626, thanks for pointing me there, I'll start tracking that one also.
Comment 36 Paul Webster CLA Friend 2014-01-17 16:42:31 EST
*** Bug 426031 has been marked as a duplicate of this bug. ***
Comment 37 Unnikrishnan B CLA Friend 2014-04-18 13:23:39 EDT
(In reply to Alexander Kurtakov from comment #7)
> (In reply to comment #6)
> > For a workaround add the following to the end of your eclipse.ini
> > 
> > -Dorg.eclipse.swt.browser.DefaultType=mozilla
> 
> Mozilla is even less reliable as it breaks with every firefox update ans SWT
> doesn't support recent xulrunner versions (20.0 here) -at least it wasn't
> last I checked.

I had the same problem in LinuxMint (petra), adding Dorg.eclipse.swt.browser.DefaultType=mozilla fixed my it. Thanks for this fix!
Comment 38 Arun Thondapu CLA Friend 2014-05-12 13:32:07 EDT
*** Bug 434588 has been marked as a duplicate of this bug. ***
Comment 39 Paul Webster CLA Friend 2014-07-08 21:46:44 EDT
*** Bug 439082 has been marked as a duplicate of this bug. ***
Comment 40 payam ben CLA Friend 2014-07-29 03:17:22 EDT
*** Bug 440571 has been marked as a duplicate of this bug. ***
Comment 41 Michael Vorburger CLA Friend 2014-08-14 04:28:20 EDT
I can confirm that using Eclipse Luna v4.4 on Ubuntu 14.04 this doesn't happen anymore.  For older Eclipse versions (e.g. 3.7.2) the -Dorg.eclipse.swt.browser.DefaultType=mozilla works for me.
Comment 42 Paul Webster CLA Friend 2014-09-04 10:22:01 EDT
*** Bug 442630 has been marked as a duplicate of this bug. ***
Comment 43 Arun Thondapu CLA Friend 2014-09-08 05:42:16 EDT
*** Bug 443457 has been marked as a duplicate of this bug. ***
Comment 44 Arun Thondapu CLA Friend 2014-12-05 02:29:32 EST
*** Bug 454196 has been marked as a duplicate of this bug. ***