Community
Participate
Working Groups
If a task executed with Display.asyncExec throws an unchecked exception, normally that exception propagates up to the code running the event loop. In an RCP application (using Eclipse 3.x), the exception is caught in Workbench.runEventLoop, and eventually gets logged (by WorkbenchAdvisor.eventLoopException) as an "Unhandled event loop exception". However if a task that throws an exception is executed while a MessageBox is open, the exception causes the UI to freeze. When a MessageBox is opened, SWT calls gtk_dialog_run, which "blocks in a recursive main loop" (according to the GTK manual). This main loop, when idle, invokes an SWT callback - Display.idleProc - that allows SWT to execute other pending tasks, even though the (modal) dialog is open. An uncaught exception while a task is being invoked *by the callback* hangs the UI. The workaround is to avoid throwing an unchecked exception from a task, even though most of the time it will just get logged as an "Unhandled event loop exception" and the application will continue running normally.
Created attachment 237882 [details] Test program that demonstrates UI freeze Test program to demonstrate UI freeze. * UI initially works fine (e.g. button can be pressed) * 1st task throws NPE; UI continues to work * 2nd task opens a MessageBox; UI continues to work * 3rd task throws NPE; UI freezes This reproduces the freeze on a variety of systems: Red Hat Enterprise Linux 6 GTK 2.18.9 SWT 3.8.1 (version 3836) Ubuntu 13.10 GTK 2.24.20 Eclipse 4.3 SR1 SWT version 4333 Fedora 19 GTK 2.24.22 Eclipse 3.7 SR2 SWT 3.7.2 (version 3740)
This is still reproducible on SWT from master as of today, GTK3.22, and Fedora 28.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Still reproducible on Fedora 32, using SWT/JFace from Eclipse 2020-06: * org.eclipse.swt.gtk.linux.x86_64_3.114.100.v20200604-0951.jar * org.eclipse.jface_3.20.0.v20200505-1952.jar version.txt in the SWT JAR says "version 4.934" Test program outputs "SWT version: 4934" GTK 3.24.20