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

Bug 501542

Summary: [GTK3] Crash when opening a GMF/GEF-based diagram using GTK 3.22
Product: [Eclipse Project] Platform Reporter: Alessio Di Sandro <dixxx84>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: akurtakov, alois.zoitl, ericwill, loskutov, pierre-charles.david, wshuman3
Version: 4.6Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Console output during startup and crash
none
Stack overvlow as reported by AERI none

Description Alessio Di Sandro CLA 2016-09-15 17:19:05 EDT
Created attachment 264185 [details]
Console output during startup and crash

I use Debian Unstable, which was recently upgraded to use GTK 3.21 (which will be officially released as 3.22 together with Gnome 3.22 in a week).

Eclipse Neon throws a whole lot of GTK warnings when starting, but it works. Then, whenever I open a GMF diagram, a Papyrus diagram, or an Ecore Sirius diagram, it crashes badly with:
Gtk:ERROR:/build/gtk+3.0-3.21.6/./gtk/gtkwidget.c:10232:gtk_widget_pop_verify_invariants: assertion failed: (widget->priv->verifying_invariants_count > 0)

I'm attaching the console output. I've tried the Neon.1 release candidate 4, same problem.
Comment 1 Alois Zoitl CLA 2016-09-16 05:45:38 EDT
I can confirm this behavior also for GEF 3 based editors in the same setups. As GEF 3 is below GMF I assume the cause is somewhere there.
Comment 2 Alois Zoitl CLA 2016-09-16 06:34:44 EDT
Based on the discussion in this thread [1] I made some more experiments and found out that it seems to be a GTK3 integration issue. If you disable SWT_GTK3 the GEF editor works again.

However I would appreciate to have GTK 3 again. 

Is there I way how I can help to track this further down?


[1] https://www.eclipse.org/forums/index.php/t/1081230/
Comment 3 Eric Williams CLA 2016-09-16 08:44:46 EDT
In general the warnings are annoying, but not critical. I did however see this in your error log:

Gtk:ERROR:/build/gtk+3.0-3.21.6/./gtk/gtkwidget.c:10232:gtk_widget_pop_verify_invariants: assertion failed: (widget->priv->verifying_invariants_count > 0)

This is most likely causing the crash. Would you be able to try with 4.7M2 to confirm the issue happens on Oxygen?
Comment 4 Alois Zoitl CLA 2016-09-16 09:42:46 EDT
As haveing developed also GTK applications from 2.something on I noticed that these warnings are now maybe less critical but may turn out in the end more problematic then expected.

I'll give Oxygen M2 a try over the weekend and keep you updated.
Comment 5 Alois Zoitl CLA 2016-09-17 08:38:18 EDT
I just tested it with Eclipse Platform 4.7.0.120160915-0230 and GEF (MFC) SDK 3.11.0.201606061308 which is the latest GEF 3.x version I could find.

However the same problems appear. I tried with the debugger (Eclipse and gdb) hoping to get some stack trace but I was not really lucky is there a way how to debug this?
Comment 6 Alexander Kurtakov CLA 2016-09-21 06:35:49 EDT
Does it happen with every gmf diagram? I tried creating a really basic one and no crash happened on my machine (Gtk 3.21.6).
Comment 7 Alois Zoitl CLA 2016-09-21 14:11:56 EDT
I did further test inspired by the last comment. I can reproduce the crash even with a completely empty GEF-based editors. Therefore I took the liberty and changed also the Bug-Title. However I have only the 4diac GEF-based editors at hand. But I tried 5 different which are medium complex to complex.

I tried to switch of the dashed grid which we had already a problem in Neon RC2. But this didn't changed anything.

What I noticed is that the editor opens up without problems (also non empty editors) but as soon as I move my mouse over the editor the Gtk assertion happens. 

Interestingly also when moving the mouse over the standard GEF outline the same crash occurs. 

I hope this helps to narrow this issue down.
Comment 8 Alois Zoitl CLA 2016-10-04 04:57:38 EDT
Created attachment 264564 [details]
Stack overvlow as reported by AERI
Comment 9 Alois Zoitl CLA 2016-10-04 04:57:56 EDT
I spend more time tracing this issue down. The following GTK+ functions are calling gtk_widget_pop_verify_invariants:

  - gtk_widget_unparent
  - gtk_widget_show
  - gtk_widget_hide
  - gtk_widget_map
  - gtk_widget_unmap
  - gtk_widget_realize
  - gtk_widget_unrealize
  - gtk_widget_size_allocate_with_baseline
  - gtk_widget_set_parent

Furthermore I noticed that after updating my machine to GTk 3.22 that the assertion is gone and now I have a stack overflow error. I added an attachment reported by AERI.
Comment 10 Eric Williams CLA 2018-05-02 15:54:39 EDT
Which OS does this happen on?
Comment 11 Alois Zoitl CLA 2018-05-02 17:19:51 EDT
This was Linux. However since updating to Oxygen I couldn't directly reproduce the issue. Or better to say I didn't further investigated.
Comment 12 Eric Williams CLA 2018-05-03 12:33:21 EDT
(In reply to Alois Zoitl from comment #11)
> This was Linux. However since updating to Oxygen I couldn't directly
> reproduce the issue. Or better to say I didn't further investigated.

Okay. I'll close this for now, if the issue happens on Photon with GTK3.22 please re-open this ticket.