ControlSystemStudio / cs-studio

Control System Studio is an Eclipse-based collections of tools to monitor and operate large scale control systems, such as the ones in the accelerator community.
https://controlsystemstudio.org/
Eclipse Public License 1.0
113 stars 96 forks source link

Work around intermittent crash when saving snapshot from Data Browser #2710

Closed aawdls closed 2 years ago

aawdls commented 2 years ago

Our users report that intermittently CSS will crash when saving a snapshot from the data browser.

The output is

[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
java: xcb_io.c:165: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.

We deduced this is another manifrstation of the issue described here https://github.com/ControlSystemStudio/cs-studio/issues/2660 and here https://github.com/ControlSystemStudio/phoebus/issues/705

This PR implements a similar workaround for the Save Snapshot. i.e. to create the image on the UI thread.

The SWT issue is still open on eclipse.org. One commenter reports that a later Eclipse version no longer has this behaviour, so it is possible that it will not be fixed in 2020-12. I expect that for us to upgrade the Eclipse version is a very big task and therefore prefer to implement this workaround in order to fix this crash for an upcoming DLS release.

cc @rjwills28

kasemir commented 2 years ago

@willrogers thanks for creating the SWT/eclipse https://bugs.eclipse.org/bugs/show_bug.cgi?id=568859, very happy to see some confirmation there (should work, but creating an image is unfortunately only possible on UI thread).