Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357761

Summary: 3.7.0 crashes with segfault inside SWT native call
Product: [Eclipse Project] Platform Reporter: Christopher Smith <christopher.smith>
Component: SWTAssignee: Grant Gayed <grant_gayed>
Status: CLOSED DUPLICATE QA Contact:
Severity: critical    
Priority: P3 CC: arunkumar.thondapu, eclipse.felipe, mail, remy.suen
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Attachments:
Description Flags
crash log
none
Another crash log none

Description Christopher Smith CLA 2011-09-15 06:13:23 EDT
Build Identifier: M20110210-1200

Eclipse (STS 2.7.1) reliably crashes with a segfault out of org.eclipse.swt.internal.gtk.OS._g_main_context_iteration.

The crash occurs on Gentoo Linux 64-bit with glibc 2.12.2 and the Sun/Oracle JDK, either 1.6.0.27 or 1.7.0.14.

This appears to be related to a rash of recent SWT segfaults; my uninformed suspicion is that a recent SWT revision introduced a bug setting up a bad pointer, and the dereference is causing crashes in a number of places.

Reproducible: Always

Steps to Reproduce:
1. Create a new blank workspace.
2. Attach the Equinox (PDE) source code.
3. Create a new plug-in project, selecting the "simple log service" template.
4. Open the OSGi ServiceTracker class from the newly-created activator.
5. Hover the class name "Tracker" on line 99.
Comment 1 Christopher Smith CLA 2011-09-15 06:16:52 EDT
I included an incorrect version in the initial report.  The problem occurs with build I20110613-1736, platform version 3.7.0.
Comment 2 Christopher Smith CLA 2011-09-15 06:17:56 EDT
Created attachment 203397 [details]
crash log
Comment 3 Sebastian Bauer CLA 2011-09-19 06:24:17 EDT
Created attachment 203580 [details]
Another crash log

Log showing that I observe a similar problem. It happens as soon as I want to start an RWT application.
Comment 4 Sebastian Bauer CLA 2011-09-19 06:29:19 EDT
(In reply to comment #3)
> Log showing that I observe a similar problem. It happens as soon as I want to
> start an RWT application.

Interestingly, it does not happen when I use an external browser.
Comment 5 Grant Gayed CLA 2011-09-22 16:44:47 EDT
I notice in the comment 2 and comment 3 dumps that they have libraries loaded for both webkitgtk and xulrunner, so presumably webkitgtk is being used for default-style Browsers and xulrunner is being explicitly requested by an app you're using on top of eclipse.  The mixing of these browser types has proven to be problematic sometimes, so a means of avoiding it was introduced in the eclipse 3.7.1 stream, see bug 349837.

To see if this is indeed the issue, please get the 3.7.1 release at http://download.eclipse.org/eclipse/downloads/drops/M20110909-1335/index.php and add the following to the end of its eclipse.ini file:

-Dorg.eclipse.swt.browser.DefaultType=mozilla
Comment 6 Sebastian Bauer CLA 2011-09-26 09:09:14 EDT
I can confirm that Eclipse no longer crashes in the same situation after forcing Eclipse to use Mozilla.
Comment 7 Grant Gayed CLA 2011-09-26 10:06:29 EDT
Thanks for following up, marking report as a duplicate of bug 349837.  I'm assuming that the original reporter's issue is the same since the crash log shows a similar situation.  If this does not prove to be the case then please reopen the report.

I'll add documentation to swt's javadoc and FAQ pages to advise that any app that absolutely requires xulrunner must set this value to ensure that the xulrunner/webkit conflict does not occur.

*** This bug has been marked as a duplicate of bug 349837 ***
Comment 8 Christopher Smith CLA 2011-10-04 18:52:40 EDT
The fix for #349837 appears to work for me.