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

Bug 315906

Summary: StyledText can crash JVM while user cursors through content
Product: [Eclipse Project] Platform Reporter: Michael Whapples <mwhapples>
Component: SWTAssignee: Silenio Quarti <Silenio_Quarti>
Status: CLOSED DUPLICATE QA Contact:
Severity: critical    
Priority: P3 CC: carolynmacleod4, eclipse.felipe, Silenio_Quarti, vilmar
Version: 3.6   
Target Milestone: 3.6.2   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Error log referred to in error message
none
log from crash while editing none

Description Michael Whapples CLA 2010-06-06 11:52:53 EDT
Created attachment 171219 [details]
Error log referred to in error message

I have noticed that it is very easy to crash the JVM while cursoring through the content of a StyledText widget when using SWT-GTK 3.6RC4.

To reproduce:
1. Download, compile and run SWT Snippet212 (Embedding images in StyledText).
2. Use the cursor keys to cursor through the content.

The result of the above is that the JVM will be crashed and a message like the following may be displayed:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xb398be16, pid=5078, tid=3066833776
#
# JRE version: 6.0_20-b02
# Java VM: Java HotSpot(TM) Client VM (16.3-b01 mixed mode, sharing linux-x86 )
# Problematic frame:
# C  [libglib-2.0.so.0+0x58e16]
#
# An error report file with more information is saved as:
# /home/mike/workspace/SWTBrowser/hs_err_pid5078.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

I attach the log file referred to in the error message.

I notice this while using eclipse in the source code editor and it happens very frequently (over three crashes in five minutes, approx) and so this makes eclipse 3.6 unusable to me.

I am using a Debian unstable system (updated last night, 5 July 2010). Although the above error is for the SunJDK, I have also tried with the OpenJDK and got similar results. The only other thing I can think of which may differ from many users configurations is that I have accessibility enabled and Orca (http://live.gnome.org/Orca) running.

I do not observe this sort of crashing when using SWT3.5.2 and eclipse3.5.x.
Comment 1 Silenio Quarti CLA 2010-06-07 11:57:55 EDT
I cannot reproduce this problem with my Ubuntu 10.04 machine. I will update the machine and try again.
Comment 2 Silenio Quarti CLA 2010-06-07 12:15:02 EDT
I still cannot reproduce after an update. What version of gtk, glib, atk and orca you have installed.
Comment 3 Michael Whapples CLA 2010-06-07 14:10:11 EDT
Here are the versions of the Debian packages (I am not fully sure which GTK and glib packages it should be but I think I've got the right ones):
gnome-orca 2.30.1-1 (I have also compiled from source with a very recent GIT version)
libatk1.0-0 1.30.0-1
libgtk2.0-0 2.20.1-1
libglib2.0-0 2.24.1-1

I could test it out on an ArchLinux system I have access to.

I remember someone on the orca-list saying that they don't observe this on ubuntu 10.04 but I think they may be using the IBM JDK which I don't think suffers a number of accessibility related bugs in eclipse.
(In reply to comment #2)
> I still cannot reproduce after an update. What version of gtk, glib, atk and
> orca you have installed.
Comment 4 Michael Whapples CLA 2010-06-07 16:48:56 EDT
I have just tried to reproduce this on an ArchLinux system (looking at its packages for glib, gtk, atk and orca, it seems as if its running the same versions as my debian system) but I have been unable to reproduce it after a few minutes (probably about five minutes trying, which on the debian system would have been time to observe it more than once).

Where does this leave things? Is it worth me trying to compile SWT on my debian system rather than using the binary version from the eclipse website?
Comment 5 Silenio Quarti CLA 2010-06-08 10:04:01 EDT
I do not think recompiling the SWT libraries will make a difference (but who knows).

There is a problem when running Sun JDK which prevents the VM from exiting.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=229071#c8

I wonder if this is causing our problem as well. Would you be able to try an IBM JDK on your debian machine? 

Before running eclipse, make sure there no old java processes hanging around in System.halt(). 

Note that I tried a Sun JDK on my ubuntu and I still cannot reproduce it.
Comment 6 Michael Whapples CLA 2010-06-10 20:15:09 EDT
I have just got the IBM JVM installed on my debian system and I still observe the crash. I had hoped may be it would have fixed things but I think it may be JVM independent (all openJDK, SunJDK and IBM JDK all show it on my debian system and openJDK doesn't show it on ArchLinux and I have heard someone say that the IBM JDK works fine on ubuntu).

While I doubt recompiling SWT will help, I will give it a go, but it may be after the weekend before I can report that result.
Comment 7 Michael Whapples CLA 2010-06-14 16:00:43 EDT
I don't know whether the following helps. I sometimes find the following message in the console (eg. this latest time trying the IBM JVM):
***MEMORY-ERROR***: SWT[18386]: GSlice: assertion failed: sinfo->n_allocated > 0

I am still to try out compiling SWT from source.
Comment 8 jose vilmar estacio de souza CLA 2010-06-23 09:28:28 EDT
Created attachment 172502 [details]
log from crash while editing

I am not sure if it is related to the same bug.
to reproduce try:
1. go to preferences | general | editors | text editors.
2. choose annotations.
3. press tab two times.
4. choose breakpoints and press tab until you find text as checkbox.
5. check this option.
6. press tab and choose underline.
7. press tab until you find include in next/previous navigation.
8. check this option.
9. Click ok.
10. Mark some lines in a class with breakpoint (using ctrl+shift+b).
11. try navigate between the lines pressing ctrl+. and ctrl+,.

The problem does not occur immediately, but suddenly I'm presented with a dump and eclipse dies.

java version "1.6.0"
Java(TM) SE Runtime Environment (build pxa6460sr8-20100409_01(SR8))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64 jvmxa6460sr8-20100401_55940 (JIT enabled, AOT enabled)
J9VM - 20100401_055940
JIT  - r9_20100401_15339
GC   - 20100308_AA)
JCL  - 20100408_01
Comment 9 jose vilmar estacio de souza CLA 2010-06-23 09:51:25 EDT
I received another crash.
Here are the messages that appeared in the console while eclipse was active.

vilmar@jve:~$ ./eclipse/eclipse 

** (Eclipse:5086): CRITICAL **: impl_getSelectedChild: assertion `ATK_IS_OBJECT (atk_object)' failed

** (Eclipse:5086): CRITICAL **: impl_getSelectedChild: assertion `ATK_IS_OBJECT (atk_object)' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

** (Eclipse:5086): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed

***MEMORY-ERROR***: Eclipse[5086]: GSlice: assertion failed: sinfo->n_allocated > 0
JVMDUMP006I Processing dump event "abort", detail "" - please wait.
JVMDUMP032I JVM requested System dump using '/home/vilmar/core.20100623.103343.5086.0001.dmp' in response to an event
JVMDUMP010I System dump written to /home/vilmar/core.20100623.103343.5086.0001.dmp
JVMDUMP032I JVM requested Snap dump using '/home/vilmar/Snap.20100623.103343.5086.0002.trc' in response to an event
JVMDUMP010I Snap dump written to /home/vilmar/Snap.20100623.103343.5086.0002.trc
JVMDUMP032I JVM requested Java dump using '/home/vilmar/javacore.20100623.103343.5086.0003.txt' in response to an event
JVMDUMP010I Java dump written to /home/vilmar/javacore.20100623.103343.5086.0003.txt
JVMDUMP013I Processed dump event "abort", detail "".
vilmar@jve:~$ 

I forgot to mention that I am using ubuntu 10.04.
Comment 10 Carolyn MacLeod CLA 2010-09-13 14:06:49 EDT
This bug is the same as bug 325028, which is now fixed. The fix will be in the next Eclipse 3.6.2 and 3.7 builds (including 3.7 M2).

*** This bug has been marked as a duplicate of bug 325028 ***