2

My application is written in Java 8 and the GUI is built upon the Eclipse plug-ins. On some of the OS versions, the application works perfectly, without any problems in the GUI. But on SUSE SLSE12 the application is hanging after being opened for a few hours. By hanging I mean, the GUI is getting stuck for a few minutes after closing some widget.

It's hard to figure out what's the reason, but after some debugging I noticed the code is getting stuck for a few minutes when we call the dispose method of package org.eclipse.swt.widgets.Shell to destroy the widget. After some additional debugging, I noticed that the hanging is coming from the following code:

public static final native void _gtk_widget_destroy(long /*int*/ widget);
public static final void gtk_widget_destroy(long /*int*/ widget) {
    lock.lock();
    try {
        _gtk_widget_destroy(widget);
    } finally {
        lock.unlock();
    }
}

And as I understand, it uses the lock variable that is coming from Platform.java to lock and then calls the native _gtk_widget_destroy method to destroy the widget. I actually asked how this method works here. But now I'm trying how to fix the hanging.

I believe the reason for this hanging is the GTK version I'm using or rather the shared library from which the _gtk_widget_destroy function is coming from. At the end, it destroys the widget, but it takes a lot of time (up to 5 minutes) and a lot of users having this issue with out application. I haved tried to set different GTK version by setting the $LD_LIBRARY_PATH but all of them lead to that slowness and even different issues with the GUI (missing components, etc).

In the previous question I asked about the _gtk_widget_destroy method and how to find the location of it. The nm command was suggested and I found out that those methods are coming from shared libs of format libgtk-.*

Since I tried to change the GTK version multiple times I'm not sure what else I can do. Some technical aspects:

  • I'm using Eclipse 4.8 with org.eclipse.swt.gtk.linux.x86_64_3.107.0.v20180611-0422.
  • As I understand, that eclipse version requires GTK 2.24 version. I'm using GTK 2.24.20 and it works great on one OS operation. But on SLES12 I don't have it installed by IT, but I did tried 2.24.32, 3.22.28 and 3.24.23.
  • I also tried to migrate to Eclipse 4.10 but it didn't solve the problem.
  • I also tried to use the GTK_DEBUG=interactive option but when my GUI is getting stuck, the GTK interactive GUI also getting stuck.

How one can debug such strange issue?

Please note that the links that I posted in this question are leading to some Github project that installed the same plugins that I did (just for you to easier understand the structure of the plugins).

vesii
  • 2,760
  • 4
  • 25
  • 71
  • Is it due to the call to `_gtk_widget_destroy` or the `lock`? I would try to log around these variables. – MaxPlankton Jun 04 '22 at 18:03
  • @JohnKoch Thanks for the comment. I logged the code and it's definitely coming from `_gtk_widget_destroy `. The `lock` and `unlock` both take around 0 milliseconds to run. While `_gtk_widget_destroy ` takes 630 milliseconds (before getting into the slowness - tested at start). – vesii Jun 05 '22 at 17:37

0 Answers0