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

Bug 382812

Summary: Eclipse crashes with Gtk:ERROR after showing workbench (Ubuntu 10.10 amd64)
Product: [Eclipse Project] Platform Reporter: Marco Massenzio <m.massenzio>
Component: SWTAssignee: 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.2Flags: Silenio_Quarti: review+
Target Milestone: 4.2.2   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
strace
none
possible fix none

Description Marco Massenzio CLA 2012-06-17 22:47:25 EDT
I've been using Eclipse 4.2 for several months now, and the M6 seemed reasonably stable and working just fine.

When I tried to use M7, I had this same error, but given there were many tests failing for that release I thought it was something transient.

However, having downloaded today the eclipse-SDK-4.2RC4-linux-gtk-x86_64.tar.gz package, it seems this is something that's here to stay:

1. clean environment (in particular, I have renamed my ~/.eclipse to bak.eclipse)
2. no customized option (just run eclipse/eclipse)
3. clean workspace (using the default ~/workspace - which did not exist and got created)

Launching eclipse, it shows the splash screen, eventually the main window and then soon as I click the "Go to Workbench" arrow, it crashes with:

**
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))

There is no .log file in .metadata, the .plugins got created, and it contains:

$ la ~/workspace/.metadata/
total 16K
drwxr-xr-x 3 marco users 4.0K 2012-06-17 19:16 .
drwxr-xr-x 3 marco users 4.0K 2012-06-17 19:16 ..
-rw-r--r-- 1 marco users 0 2012-06-17 19:16 .lock
drwxr-xr-x 8 marco users 4.0K 2012-06-17 19:16 .plugins
-rw-r--r-- 1 marco users 26 2012-06-17 19:16 version.ini
[~/Downloads/eclipse]
$ la ~/workspace/.metadata/.plugins/
total 32K
drwxr-xr-x 8 marco users 4.0K 2012-06-17 19:16 .
drwxr-xr-x 3 marco users 4.0K 2012-06-17 19:16 ..
drwxr-xr-x 4 marco users 4.0K 2012-06-17 19:16 org.eclipse.core.resources
drwxr-xr-x 3 marco users 4.0K 2012-06-17 19:16 org.eclipse.core.runtime
drwxr-xr-x 2 marco users 4.0K 2012-06-17 19:16 org.eclipse.jdt.core
drwxr-xr-x 2 marco users 4.0K 2012-06-17 19:16 org.eclipse.jdt.ui
drwxr-xr-x 2 marco users 4.0K 2012-06-17 19:16 org.eclipse.ui.intro
drwxr-xr-x 2 marco users 4.0K 2012-06-17 19:16 org.eclipse.ui.workbench

NOTE:: RC3 works just fine on another system of mine (Kubuntu 12.04)
Comment 1 Arun Thondapu CLA 2012-06-18 05:56:54 EDT
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!
Comment 2 Marco Massenzio CLA 2012-06-18 12:55:52 EDT
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
Comment 3 Silenio Quarti CLA 2012-06-18 14:33:33 EDT
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
Comment 4 Marco Massenzio CLA 2012-06-18 17:39:26 EDT
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!
Comment 5 Marco Massenzio CLA 2012-06-27 22:13:01 EDT
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
Comment 6 David Rieck CLA 2012-06-28 10:15:45 EDT
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))
Comment 7 Marco Massenzio CLA 2012-06-28 13:34:55 EDT
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.
Comment 8 Mika Fischer CLA 2012-06-29 05:43:24 EDT
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
Comment 9 Arun Thondapu CLA 2012-06-30 11:41:37 EDT
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?
Comment 10 Mika Fischer CLA 2012-06-30 11:54:04 EDT
(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.
Comment 11 Marco Massenzio CLA 2012-06-30 14:14:55 EDT
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)
Comment 12 Marco Massenzio CLA 2012-06-30 14:21:23 EDT
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.
Comment 13 Marco Massenzio CLA 2012-06-30 14:23:52 EDT
(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.
Comment 14 Mika Fischer CLA 2012-07-02 05:12:26 EDT
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
Comment 15 Silenio Quarti CLA 2012-07-04 10:52:16 EDT
Please attach the full VM log/stack dump. Is it a Sun, IBM or OpenJDK VM? I could not tell from the version.
Comment 16 Marco Massenzio CLA 2012-07-05 02:19:56 EDT
(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.
Comment 17 Mike P CLA 2012-07-07 15:10:53 EDT
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.
Comment 18 Jacob Lechocki CLA 2012-07-11 07:22:03 EDT
Same problem on Arch Linux with Gnome 3 (cinnamon) and Oracle Java 7.5

Problem does not occurs on Openbox
Comment 19 Silenio Quarti CLA 2012-07-11 10:01:08 EDT
(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.
Comment 20 Steven Allen CLA 2012-07-11 12:11:21 EDT
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
Comment 21 Steven Allen CLA 2012-07-11 13:09:12 EDT
Created attachment 218584 [details]
strace
Comment 22 Emmanuel Bigeon CLA 2012-07-11 13:39:44 EDT
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...
Comment 23 Yannik Stein CLA 2012-07-12 06:25:51 EDT
(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
Comment 24 David-Jane Shawn CLA 2012-07-12 11:35:21 EDT
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.
Comment 25 Ivan Borisov CLA 2012-07-12 11:58:45 EDT
(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.
Comment 26 Yannik Stein CLA 2012-07-12 17:25:19 EDT
Thanks for the workaround!
Comment 27 Marco Massenzio CLA 2012-07-12 21:59:06 EDT
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)
Comment 28 Emmanuel Bigeon CLA 2012-07-13 04:08:54 EDT
Changing the gtk-toolbar-icon-size worked for me. Thanks a lot.
Comment 29 Nathan Peterson CLA 2012-07-14 01:28:56 EDT
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.
Comment 30 Marco Massenzio CLA 2012-07-14 16:35:41 EDT
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.
Comment 31 Silenio Quarti CLA 2012-07-16 17:40:55 EDT
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!
Comment 32 Silenio Quarti CLA 2012-07-16 17:42:05 EDT
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();
}

}
Comment 33 Marco Massenzio CLA 2012-07-17 03:34:19 EDT
(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!
Comment 34 Marco Massenzio CLA 2012-07-17 03:58:17 EDT
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();
> }
> 
> }
Comment 35 Silenio Quarti CLA 2012-07-17 11:19:55 EDT
(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))
Comment 36 Silenio Quarti CLA 2012-07-17 12:27:13 EDT
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.
Comment 37 Marco Massenzio CLA 2012-07-21 20:46:18 EDT
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
Comment 38 Silenio Quarti CLA 2012-07-23 09:56:25 EDT
Thanks for verifying the fix.
Comment 39 Arun Thondapu CLA 2012-08-23 09:10:27 EDT
*** Bug 387851 has been marked as a duplicate of this bug. ***
Comment 40 Silenio Quarti CLA 2012-08-29 09:47:54 EDT
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
Comment 41 Marco Massenzio CLA 2012-09-03 14:58:51 EDT
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!
Comment 42 Arun Thondapu CLA 2012-09-11 03:18:05 EDT
*** Bug 389199 has been marked as a duplicate of this bug. ***
Comment 43 Paul Webster CLA 2012-09-28 07:15:03 EDT
*** Bug 390395 has been marked as a duplicate of this bug. ***
Comment 44 Marco Massenzio CLA 2012-09-29 02:00:08 EDT
@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!
Comment 45 Arun Thondapu CLA 2012-11-19 04:22:08 EST
*** Bug 394553 has been marked as a duplicate of this bug. ***
Comment 46 Max Rydahl Andersen CLA 2013-01-08 06:11:42 EST
Any chance this bug can be backported and applied to 4.2/Juno ?
Comment 47 Bogdan Gheorghe CLA 2013-01-15 16:11:36 EST
Patch backported to R4_2_maintenance and R3_8_maintenance