Open torokati44 opened 1 year ago
Sorry about the waiting time, SWT currently has few active maintainers. I'm generally interested in JVM crashes, and plan to have a look at this eventually. Unfortunately the waiting time could be around a month.
Hello, just a ping on this issue: We are still often encountering this crash on an almost daily basis... :/
SWT is currently low on active contributors. It would be nice if you can debug the problem yourself and prepare a fix. Otherwise, alas, you'll have to wait more, and there's no ETA.
Otherwise, alas, you'll have to wait more, and there's no ETA.
Of course, I understand, FOSS is what it is...
It would be nice if you can debug the problem yourself and prepare a fix.
Actually we ended up tossing the problematic pieces of code (in this one and #697) into a Display.asyncExec
callback, so they can be done at a time when Gtk is hopefully no longer confused. It's dumb, but appears to be working so far.
I found a way to reproduce all the time in a @flatpak runtime, where also all workarounds fail.
It would be useful if you describe how exactly do you reproduce.
Sorry, I thought that it won't be that helpful because you need to build a package to test.
Here it is https://github.com/Mailaender/flathub/compare/chemclipse Check the README for the commands to build it.
Click Demo
on the green intro screen to trigger the crash.
Use
runtime-version: 20.08
and rebuild to see how the application looked before the crash was introduced.
Oh, I didn't expect a whole other application. Indeed I don't have the time to debug it.
Can you please post your hs_err_pid.log
crash reports?
You can also indirectly trigger this with
public class MyLabelProvider extends LabelProvider implements ILabelProvider {
@Override
public Image getImage(Object element) {
// return something other then null
}
}
This is sometimes difficult to reproduce. I had my best chances when there was only one unexpanded item in the tree viewer.
I can't reproduce this in a development environment so this might be already accidentally fixed?
We still have the Display.asyncExec
workaround in place, so I can't comment on it, as we haven't encountered it since.
It's possible it got fixed, but I can't verify it due to lack of time, sorry.
There are occasions where the Display.asyncExec
either does not work or only lessens the problem.
I just copied your snippet into my 2023-03 project and it crashed. It does not when I try it here.
The instructions at https://www.eclipse.org/swt/git.php are somehow outdated or not very precise, but this should work:
Install git-lfs
. Git clone this repository. Only import the repositories (plus snippets) and rename or copy
I just ignored the API baseline error and got a test environment where the problem is not reproducible or hopefully already fixed.
Updated consecutively up to Eclipse 2023-12 and the crash is still there.
While trying to work around it, I found another way to crash more reliable:
public class MyLabelProvider extends LabelProvider implements ILabelProvider {
@Override
public Image getImage(Object element) {
try {
Thread.sleep(100);
} catch(InterruptedException e) {
logger.warn(e);
}
new Image(display, 16, 16))
}
}
I have no real fix yet, and the TreeViewer
API does not allow for a simple override of the setImage
function. However, I found out that only the first setImage
will crash, all subsequent won't. So setImage(null)
will make all following calls safe.
I also don't understand why this crash does not happen with the Eclipse IDE. The PDE Project Explorer and Java Package Explorer as well as the Git Repositories all use trees with icons.
Just an observation: running original snippet from the ticket description I see no crash but following GTK errors on GTK 3.22 / RHEL 7.9
(SWT:67615): GLib-GObject-CRITICAL **: 14:43:43.462: g_object_notify_queue_thaw: assertion 'nqueue->freeze_count > 0' failed
(SWT:67615): GLib-CRITICAL **: 14:43:43.462: g_hash_table_foreach: assertion 'version == hash_table->version' failed
and following on GTK 3.24 / RHEL 9.2:
(SWT:1512449): GLib-GObject-CRITICAL **: 14:47:50.210: g_object_set: assertion 'G_IS_OBJECT (object)' failed
(SWT:1512449): GLib-GObject-WARNING **: 14:47:50.210: invalid unclassed pointer in cast to 'GObject'
(SWT:1512449): GLib-GObject-CRITICAL **: 14:47:50.210: g_object_thaw_notify: assertion 'G_IS_OBJECT (object)' failed
(SWT:1512449): GLib-CRITICAL **: 14:47:50.210: g_hash_table_foreach: assertion 'version == hash_table->version' failed
However, I found out that only the first
setImage
will crash, all subsequent won't. SosetImage(null)
will make all following calls safe.
Let's say it makes most calls safe. My workaround only reduces the occurrence of the crash.
I think this was introduced in GTK version jump between Ubuntu 22.04 → Ubuntu 24.04.
I think this was introduced in GTK version jump between Ubuntu 22.04 → Ubuntu 24.04.
You mean it doesn't crash on 22.04 but crashes on 24.04 ?
I updated our Eclipse RCPTT UI testing server recently and it also started randomly crashing. However, it does not preserve the stack trace and is not reproducible between runs.
OpenJDK from Ubuntu or Temurin from Eclipse, JVM does not seem to matter here.
I think the difference between Eclipse IDE and Eclipse ChemClipse is that the Data Explorer (file viewer) halts the whole application while it waits for I/O related things. It either crashes right at the beginning when folders are traversed or not at all, as in it never crashes except during startup. The Eclipse IDE has a way more responsive UI while it is still loading things.
Describe the bug
Virtual
Tree
widget crashes JVM (through GTK3) when settingImage
ontoTreeItem
inListener
toSWT.SetData
. This is a continuation of https://bugs.eclipse.org/bugs/show_bug.cgi?id=573090.To Reproduce
Expected behavior
The application always shows a window with a tree widget in it, containing one item, with a small white icon.
Screenshots
Not applicable.
Environment:
Select the platform(s) on which the behavior is seen:
Additional OS info (e.g. OS version, Linux Desktop, etc)
Operating System: Fedora Linux 38 KDE Plasma Version: 5.27.4 KDE Frameworks Version: 5.105.0 Qt Version: 5.15.9 Kernel Version: 6.2.15-300.fc38.x86_64 (64-bit) Graphics Platform: Wayland Processors: 16 × AMD Ryzen 7 3800X 8-Core Processor Memory: 31.2 GiB of RAM Graphics Processor: AMD Radeon RX 550 Series
org.eclipse.swt.internal.gtk.version=3.24.37
JRE version: OpenJDK Runtime Environment Temurin-17.0.7+7 (17.0.7+7) (build 17.0.7+7) Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (17.0.7+7, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
Version since
Tested on Eclipse 4.27 (SWT 4.958).
Workaround (or) Additional context
The crash doesn't always happen, but fairly often. Removing the
TreeItem.setImage
call avoids the crash entirely.