| Summary: | Eclipse crashes with Gtk:ERROR after showing workbench (Ubuntu 10.10 amd64) | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Marco Massenzio <m.massenzio> | ||||||
| Component: | SWT | Assignee: | Silenio Quarti <Silenio_Quarti> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | critical | ||||||||
| Priority: | P3 | CC: | 4kpeuk_eclipse, 4slam, arunkumar.thondapu, bugzilla-eclipse, bzb.dev001, code, daniel_megert, david_williams, devlinux2, dileepm, dirk.hoffmann, emmanuel.bigeon, empx, gheorghe, jacob.lechocki, manderse, mika.fischer, moragab, pwebster, richardfearn, rieck.david, Silenio_Quarti, steven, thorsten, warrior.of.elyon, yannikstein | ||||||
| Version: | 4.2 | Flags: | Silenio_Quarti:
review+
|
||||||
| Target Milestone: | 4.2.2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Marco Massenzio
I just tried the RC4 build on Ubuntu 11.10 64-bit and was unable to reproduce the crash with the steps mentioned above. Can you please try this same build on a different Linux box (physical/virtual) if possible and see if the problem persists? If not, there is probably something wrong with the GTK libraries on this machine, may be you can try an uninstall/reinstall of GTK libs to confirm? Thanks! Hi Arun, thanks for doing this - just to clarify, as mentioned, I'm seeing the issue on Ubuntu 10.10 (you said you tried on 11.10?) I appreciate that it's not even an LTS version, but I suspect 10.04 LTS, would have a similar issue - plus I was confused by M6 working just fine (but M7 not). I'll try out RC4 on my other (12.04) box, but don't anticipate any problem - M7 and RC3 worked just fine. Thanks, M I was not able to reproduce this on Ubuntu 10.04.3 LTS x86_64 running 4.2RC4. GTK Version: libgtk2.0-0 2.20.1-0ubuntu2 ok - thanks that's useful to know, as I now know it's some gremlin in my own setup, I'll go chasing it. Thanks, guys! This now happens with the released version of Juno, and I seem to have the latest GTK 2.0-0 version installed: $ sudo apt-get install libgtk2.0-0 Reading package lists... Done Building dependency tree Reading state information... Done libgtk2.0-0 is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. $ bin/eclipse/eclipse org.eclipse.jst.j2ee.internal.deployables.JEEFlattenParticipantProvider ** Gtk:ERROR:/build/buildd/gtk+2.0-2.22.0/gtk/gtkwidget.c:8828:gtk_widget_real_map: assertion failed: (gtk_widget_get_realized (widget)) Note that I'm now able to start Eclipse, do some work (eg, create a project, setup a Tomcat server runtime) but then it will randomly crash with the above message. $ uname -a Linux mordor 2.6.35-32-generic #67-Ubuntu SMP Mon Mar 5 19:39:49 UTC 2012 x86_64 GNU/Linux $ lsb_release -a LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:cxx-3.0-amd64:cxx-3.0-noarch:cxx-3.1-amd64:cxx-3.1-noarch:cxx-3.2-amd64:cxx-3.2-noarch:cxx-4.0-amd64:cxx-4.0-noarch:desktop-3.1-amd64:desktop-3.1-noarch:desktop-3.2-amd64:desktop-3.2-noarch:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.0-amd64:graphics-3.0-noarch:graphics-3.1-amd64:graphics-3.1-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-3.2-amd64:printing-3.2-noarch:printing-4.0-amd64:printing-4.0-noarch:qt4-3.1-amd64:qt4-3.1-noarch Distributor ID: Ubuntu Description: Ubuntu 10.10 Release: 10.10 Codename: maverick I get the same error when I try to switch to another view (e.g. debug). (Linux Mint 11 Katya, 2.6.38.8-generic amd64) GTK Version in error is slightly different: Gtk:ERROR:/build/buildd/gtk+2.0-2.24.4/gtk/gtkwidget.c:8832:gtk_widget_real_map: assertion failed: (gtk_widget_get_realized (widget)) Do you know whether RC2 (or earlier) worked for you? It is pretty stable for me on the same system, it would be good to 'bracket' it, so we can ideally figure out what was the code change that triggered the assertion error. I'm getting the same error on Arch Linux: Gtk:ERROR:gtkwidget.c:8828:gtk_widget_real_map: assertion failed: (gtk_widget_get_realized (widget)) $ pacman -Qi gtk2 | grep Version Version : 2.24.10-3 I'll try to fix this bug but I need to be able to reproduce it in a reliable fashion to be able to debug it. Where do you see this error message? Does it appear on the console or in the logs? Can you continue using Eclipse or is it causing a crash? Also, do you think it is a 64-bit specific bug or does it happen on 32-bit Linux too? (In reply to comment #9) > Where do you see this error message? Does it appear on the console or in the > logs? On the console. > Can you continue using Eclipse or is it causing a crash? It's causing a crash. It makes Eclipse unusable. > Also, do you think it is a 64-bit specific bug or does it happen on 32-bit Linux too? I don't have any 32-bit systems left to test this. Curiously though, on my home machine which is also running Arch, the problem doesn't occur. Even though the JVM, the GTK version and most other things should be exactly the same... I'll try on Monday whether I can find out what the difference is on my work machine, where it's crashing. Thanks, Arun! I love Eclipse, love 4.2 even more and it would be great to be able to use it on my main dev machine (home PC) As a way of narrowing down the scope of changes that may have caused it, it's something that happened between RC2 (very stable) and RC4 (just crashes) and still exists in the release version > Where do you see this error message? solely when I run Eclipse on the terminal (shell) - there are no log messages prior to this to point to anything else going wrong (either console of .log) > Can you continue using Eclipse or is it causing a crash? No, it just terminates abruptly > Also, do you think it is a 64-bit specific bug or does it happen on 32-bit Linux too? My system is 64-bit, and I don't have any 10.10 32 bit to try this out. However, I have a couple of netbooks running 32-bit that I can try out (although, they both are on 12.04, so I don't think this will really help you) Would you like me to try and run it with, for example, an strace around it to see if we can narrow it down? do you have any suggestions so as to what I could narrow it to? (strace -o option, IIRC) Ah, forgot to mention. The point at which it crashes seems to be 'moving' - it initially happened just after the splash screen - then it was when I clicked on the 'curved arrow' to go to workbench from the welcome screen -- then I was able to even create a WTP project.... I'm not sure this helps or contributes to confuse matters, but (now I know someone is going to work on it) I'm more than happy to continue trying to use it and see if we can get any further insight. Thanks again, Marco. PS - if you are having trouble reproducing it, I have no problem in giving you ssh -X remote access to my system. Just let me know. (In reply to comment #11) > As a way of narrowing down the scope of changes that may have caused it, it's > something that happened between RC2 (very stable) and RC4 (just crashes) and > still exists in the release version Just re-read my original filing - clearly my recollection failed me: it must have been something that happened between M6 and M7. Apologies for confusion. Unfortunately, I could not find the difference between my work and home boxes. And on my work box I can reliably reproduce the bug by clicking on any of the tabs in the lower pane (i.e. Tasks, Console, Properties, Call Graph). System: Arch Linux GTK2 version: 2.24.10-3 JDK version: 6.b24_1.11.3-1 Please attach the full VM log/stack dump. Is it a Sun, IBM or OpenJDK VM? I could not tell from the version. (In reply to comment #15) > Please attach the full VM log/stack dump. I don't get any 'dump' - if you can let me know what to look for, I can certainly try to get it. > Is it a Sun, IBM or OpenJDK VM? I > could not tell from the version. $ java -version java version "1.7.0_03" Java(TM) SE Runtime Environment (build 1.7.0_03-b04) Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode) It's the Sun JDK 7 - here's all there is in the .metadata/.log: !SESSION 2012-07-04 23:12:49.743 ----------------------------------------------- eclipse.buildId=I20120608-1400 java.version=1.7.0_03 java.vendor=Oracle Corporation BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product !ENTRY org.eclipse.core.resources 2 10035 2012-07-04 23:13:22.069 !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. Happens on my 64bit gentoo machine using openjdk/icedtea aswell. java version "1.7.0_05" OpenJDK Runtime Environment (IcedTea7 2.2.1) (Gentoo build 1.7.0_05-b21) OpenJDK 64-Bit Server VM (build 23.0-b21, mixed mode) gtk+ versions 2.24.10 and 3.4.3 installed. Same problem on Arch Linux with Gnome 3 (cinnamon) and Oracle Java 7.5 Problem does not occurs on Openbox (In reply to comment #16) > (In reply to comment #15) > > Please attach the full VM log/stack dump. > > I don't get any 'dump' - if you can let me know what to look for, I can > certainly try to get it. There is usually a hs*.log file in the root of the eclipse installation after a crash. Switching into and then out of either the Javadoc or Declaration tab triggers this for me. The contents of the tab shows up as a black square. I tested this on a fresh eclipse install (official build) in a new workspace. No logs/dumps were generated. Architecture: x86_64 Java Version: OpenJDK Runtime Environment (IcedTea7 2.2.1) (ArchLinux build 7.u5_2.2.1-1-x86_6 4) OpenJDK 64-Bit Server VM (build 23.0-b21, mixed mode) Eclipse version: Version: 4.2.0 Build id: I20120608-1400 GTK Version: 2.24.10 Created attachment 218584 [details]
strace
I guess it won't help much, but as much I dislike using the root user to run program, it seems that eclipse 4.2 runs fine when I do. If i run it with my user, it crash as described above... (In reply to comment #22) > I guess it won't help much, but as much I dislike using the root user to run > program, it seems that eclipse 4.2 runs fine when I do. If i run it with my > user, it crash as described above... I can not confirm this. Running eclipse as root user leads to the same error. System: Archlinux (64bit) java version "1.7.0_05" Java(TM) SE Runtime Environment (build 1.7.0_05-b05) Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode) gtk2: 2.24.10 gtk3: 3.4.3 I can confirm this bug on arch 64. Worked for me as root though. Started poking around and what seems to be the issue for me is in ~/.gtkrc-2.0 If gtk-toolbar-icon-size is anything but GTK_ICON_SIZE_LARGE_TOOLBAR eclipse crashes as specified by OP and others. So for now, I have eclipse working but my gtk-settings are not as I'd prefer. Anyways, perhaps a temporary workaround for others suffering from the same issue. What makes me think though, surely more than me and a handful are using other styles for the gtk-toolbar-icon-size? Small icons for instance? How come this bug seems so rare than? Is this the root-cause or is there something else at play? Anyways, hope this helps. (In reply to comment #24) > If gtk-toolbar-icon-size is anything but GTK_ICON_SIZE_LARGE_TOOLBAR eclipse > crashes as specified by OP and others. Thanks, it helped. I'm also at Arch x64. Thanks for the workaround! running as root (sudo /opt/eclipse/eclipse) does not work for me (Ubuntu 10.10, amd64) (In reply to comment #25) > (In reply to comment #24) > > If gtk-toolbar-icon-size is anything but GTK_ICON_SIZE_LARGE_TOOLBAR eclipse > > crashes as specified by OP and others. > tried also to add the gtk-toolbar-icon-size entry, but I don't have a .gtkrc-2.0 in my home dir, so I created one with just that one line, it didn't help. could you please attach one that works for you? I'm not sure about syntax, etc. PS - no hs*.log files anywhere (home dir, eclipse dir, nowhere) Changing the gtk-toolbar-icon-size worked for me. Thanks a lot. I was having the same issue on Fedora 17 with Gnome 3. Adding 'gtk-toolbar-icon-size = GTK_ICON_SIZE_LARGE_TOOLBAR' to .gtkrc fixed it for me. For those of you who do not have a .gtkrc file in your home directory: 1. Check what GTK theme you are using. I'm using OMG. 2. a. Navigate to /usr/share/themes/[your_theme] ie: /usr/share/themes/OMG b. If your theme is not present in /usr/share/themes, check ~/.themes to see if your theme is present there. 3. Open the .gtkrc file in that directory and add: 'gtk-toolbar-icon-size = GTK_ICON_SIZE_LARGE_TOOLBAR' Or edit the 'gtk-toolbar-icon-size' line if it is present. Also, if you are having issue with dark themes and Eclipse Juno, check out Roger Dudler's Dark Juno theme here: https://github.com/eclipse-color-theme/eclipse-ui-themes Hope this helps some people out. Thanks, none of this worked. I also tried fiddling with other gtk settings in the gtkrc file (BTW - no .gtkrc - the file is named gtkrc) but to no avail: the error happens repeatably when hitting anyone of the tabs in the bottom view (eg, Javadoc or Description) and also when switching perspective. Regrettably, this seems to have been introduced when I did an update on my 4.2M6 install, which now crashes too (it used to work just fine). I tracked down (I think) the error to the following code in gtkwidget.c (lines 4465-4478) (http://www.koders.com/c/fid0A9816388EAEA2547004ED458C94A5ABB43F53BC.aspx) static void gtk_widget_real_map (GtkWidget *widget) { g_return_if_fail (GTK_IS_WIDGET (widget)); --> g_return_if_fail (GTK_WIDGET_REALIZED (widget) == TRUE); <--- if (!GTK_WIDGET_MAPPED (widget)) { GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); if (!GTK_WIDGET_NO_WINDOW (widget)) gdk_window_show (widget->window); } } It would be great to know what triggers that - I currently cannot use Eclipse 4.2 at all. Created attachment 218776 [details] possible fix We were able to reproduce this problem after setting gtk-toolbar-icon-size to something other than GTK_ICON_SIZE_LARGE_TOOLBAR. Thanks for tracking this down. The crash happens when Control.setParent() is called by the workbench to reparent a ToolBar. It seems there is a bug in gtk_widget_reparent() when called for a GtkToolbar. This FAQ explains the problem: http://developer.gnome.org/gtk-faq/stable/x635.html This patch reimplements Control.setParent() using the suggested code in the FAQ. It fixes the problem for us. Marco, would be able to try this patch out? Thanks! Here is a simple testcase:
import org.eclipse.swt.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;
public class Snippet153 {
static String statusText = "";
public static void main(String[] args) {
Device.DEBUG = true;
final Display display = new Display();
Shell shell = new Shell(display);
shell.setBounds(10, 10, 200, 200);
final ToolBar bar = new ToolBar(shell, SWT.BORDER);
bar.setBounds(10, 10, 150, 50);
new ToolItem(bar, SWT.NONE);
final Shell shell1 = new Shell(display);
shell1.setBounds(500, 10, 200, 200);
shell1.open();
bar.addListener(SWT.MouseDown, new Listener() {
public void handleEvent(Event e) {
bar.setParent(shell1);
}
});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
}
(In reply to comment #31) > We were able to reproduce this problem after setting gtk-toolbar-icon-size to > something other than GTK_ICON_SIZE_LARGE_TOOLBAR. Thanks for tracking this > down. This does not seem to fix the problem with my current setup (Ubuntu 10.10, amd64): I did a clean Eclipse install, on a brand new workspace, my .gtkrc-2.0 looks like this: $ cat .gtkrc-2.0 # Added to avoid Eclipse crash gtk-toolbar-icon-size = GTK_ICON_SIZE_LARGE_TOOLBAR (I've also added .gtkrc symlink to it, as I'm not entirely sure which one gets called) but I still experience the crash when changing tabs on the lower view. (Incidentally, I can successfully reproduce the issue as described by others on a 12.04 KDE install) > Marco, would be able to try this patch out? Thanks! Thanks for the patch! I guess this would require me (if I get this right) to build Eclipse platform from source, right? Although I've done my fair bit of plugin dev, I'm not quite sure how to do that: if can you please point me to some how-to docs, I'd be happy to figure this one out. Or I'll just Google it ;) (or if you can point me to a place where to download a new binary, I'd be happy to try that one out instead) Thanks everyone for jumping on this, appreciated! What is this supposed to show? I only see the two empty windows (the toolbar does not appear to be visible). Clicking on either, does not make anything happen. (In reply to comment #32) > Here is a simple testcase: > import org.eclipse.swt.*; > import org.eclipse.swt.events.*; > import org.eclipse.swt.graphics.*; > import org.eclipse.swt.widgets.*; > > public class Snippet153 { > > static String statusText = ""; > public static void main(String[] args) { > Device.DEBUG = true; > final Display display = new Display(); > Shell shell = new Shell(display); > shell.setBounds(10, 10, 200, 200); > final ToolBar bar = new ToolBar(shell, SWT.BORDER); > bar.setBounds(10, 10, 150, 50); > new ToolItem(bar, SWT.NONE); > final Shell shell1 = new Shell(display); > shell1.setBounds(500, 10, 200, 200); > shell1.open(); > bar.addListener(SWT.MouseDown, new Listener() { > public void handleEvent(Event e) { > bar.setParent(shell1); > } > }); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) display.sleep(); > } > display.dispose(); > } > > } (In reply to comment #34) > What is this supposed to show? I only see the two empty windows (the toolbar > does not appear to be visible). > Clicking on either, does not make anything happen. > You are not able to see the toolbar because the tool item has no text. Just add some test to it: new ToolItem(bar, SWT.NONE).setText("item"); When I click the toolbar/toolitem, it is supposed to be reparented to the other window, but instead I get the same message and a crash. ** Gtk:ERROR:/build/buildd/gtk+2.0-2.22.0/gtk/gtkwidget.c:8828:gtk_widget_real_map: assertion failed: (gtk_widget_get_realized (widget)) I pushed this patch into the master branch. You can either try it by loading the SWT code from git. Follow these instructions: http://eclipse.org/swt/git.php Or waiting for the next 4.3 nightly or integration build (next Tuesday). I am marking this as fixed for now. Reopen if you still can reproduce it with a new build. Silenio, you're a superstar! Confirmed fixed with the following build: Eclipse SDK Version: 4.2.0 (*) Build id: N20120720-2000 *) I confirm it's a 4.3 nightly build, but that's what it says in the Help/About Also - I can reliably reproduce the error with your testcase: $ java -cp /home/marco/Downloads/eclipse/plugins/org.eclipse.swt_3.101.0.N20120720-2000.jar:/home/marco/Downloads/eclipse/plugins/org.eclipse.swt.gtk.linux.x86_64_3.101.0.N20120720-2000.jar:. rt.Snippet ---> works just fine. Instead, soon as I click on the toolbar item with the older JARs in the classpath: $ java -cp /home/marco/Downloads/eclipse/plugins/org.eclipse.swt_3.100.0.N20120716-2000.jar:/home/marco/Downloads/eclipse/plugins/org.eclipse.swt.gtk.linux.x86_64_3.100.0.N20120716-2000.jar:. rt.Snippet java.lang.Error at org.eclipse.swt.graphics.Device.logProc(Device.java:741) at org.eclipse.swt.internal.gtk.OS._gtk_widget_reparent(Native Method) at org.eclipse.swt.internal.gtk.OS.gtk_widget_reparent(OS.java:12326) at org.eclipse.swt.widgets.Control.setParent(Control.java:4235) at rt.Snippet$1.handleEvent(Snippet.java:46) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1276) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3554) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3179) at rt.Snippet.main(Snippet.java:57) (SWT:6132): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed java.lang.Error at org.eclipse.swt.graphics.Device.logProc(Device.java:741) at org.eclipse.swt.internal.gtk.OS._gtk_widget_reparent(Native Method) at org.eclipse.swt.internal.gtk.OS.gtk_widget_reparent(OS.java:12326) at org.eclipse.swt.widgets.Control.setParent(Control.java:4235) at rt.Snippet$1.handleEvent(Snippet.java:46) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1276) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3554) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3179) at rt.Snippet.main(Snippet.java:57) (SWT:6132): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed ** Gtk:ERROR:/build/buildd/gtk+2.0-2.22.0/gtk/gtkwidget.c:8828:gtk_widget_real_map: assertion failed: (gtk_widget_get_realized (widget)) Aborted Thanks for verifying the fix. *** Bug 387851 has been marked as a duplicate of this bug. *** These changes caused bug#387496. I have removed these changes and released an alternative fix. Please try the next integration build again. http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=f161484e8ba50495a84a24c63f2849d4a2a53fb6 From the download page, I see the integration build (I20120828-0800) is of 8/28, so I'm not sure it has your most recent fixes. The nightly build is from 9/2, so it probably does. What would you suggest? I can wait for the next integration build when it's out (when?) or try the nightly. BTW - 4.3M1 works very nicely, that's great! Thanks for all your work on this! *** Bug 389199 has been marked as a duplicate of this bug. *** *** Bug 390395 has been marked as a duplicate of this bug. *** @Silenio: sorry, completely forgot to update this one: I've now downloaded 4.3M2 (a week or so back, I think) and been using it without any problem at all. Eclipse SDK Version: 4.3.0 Build id: I20120920-1300 Again, thanks for the super-quick fix! *** Bug 394553 has been marked as a duplicate of this bug. *** Any chance this bug can be backported and applied to 4.2/Juno ? Patch backported to R4_2_maintenance and R3_8_maintenance |