-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal crash in databrowser on Linux #2660
Comments
The same happens in phoebus, ControlSystemStudio/phoebus#705 With phoebus, I've occasionally seen it on startup. Googling around led me to believe that it can be caused by calling UI code off the UI thread, but unclear where that would be taking place. |
We had the same error in ITER. Every time we'd open the databrowser CS-Studio would crash. Debugging I found that these lines aren't executed in a UI thread. We solved it by wrapping them in a |
The whole point of the data browser is that the image is created in a background thread, so moving |
@GuillemCastro lucky you saw this ticket, thanks. That gives us a lot more information. |
We have tried putting I can't find any way to make a smaller change that fixes the problems. The code as it is will fail in a number of ways and even if I change |
See DiamondLightSource@a18f978 for that change. |
Can you tell where it's locking/failing? |
I made a minimal copy of your Phoebus code and then caught a deadlock in the debugger, you can see quite a lot in this image. It appears to have locked at the I notice that there are two "RTPlotUpdateThrottle" threads, I don't know whether that is correct. |
For what it's worth, in the current phoebus incarnation the "RTPlotUpdateThrottle" is different. There's just one global "UpdateThrottle" thread (since there's also just one UI, after all), and an "RTPlot" pool sized to match the CPU core count. The images are also created in a double-buffer scheme, i.e. 2 per plot which are then re-used. So it's all quite different and doesn't help at all to explain what you're seeing in the SWT code. I can't tell what's blocking here, i.e. who's holding the lock, but I think the approach could be changed.
|
The way you use syncExec, you might as well put the result in an AtomicReference:
|
Aha yes |
Actually, I'd try asyncExec to decouple the threads. |
The 'syncExec' can block forever (or until the next power outage). With asyncExec, the CompletableFuture.get(..) will time out after 500ms, so you skip one update, but you're not stuck. |
I didn't actually understand that |
It seems that any use of the |
Bummer. It's certainly possible that the latest version of SWT limits all access to the UI thread, i.e. can no longer use SWT to prepare images in the background. So you'll have to run updateImageBuffer() in the UI thread. Or use databrowser3, or phoebus, which actually draw in the background with AWT. |
I asked on an Eclipse mailing list but it hasn't got through moderation, and I asked on the Eclipse forums but I haven't had an answer. I think we are going to have to move more processing to the UI thread, and then revisit this either if we see performance problems or if I find out any more information about SWT. |
Not sure if there is an officially blessed SWT example for preparing images in background threads, then loading them on the SWT thread. But there is no such example in the official https://www.eclipse.org/swt/snippets/ |
I have opened an Eclipse bug here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=568859. Here is a relevant reply from the mailing list.
|
Try Snippet141 from https://www.eclipse.org/forums/index.php/t/168168/ :
combined with the fix suggested further down in that thread to then use |
It seems that there has been a bug introduced that causes problems when creating an |
Having built CS-Studio against the latest Eclipse version, we have a serious problem that I have not seen before.
Simply opening the databrowser causes CS-Studio to disappear immediately, leaving only the following error:
@kasemir I realise that you won't have much interest in fixing this, but do you have any ideas as to where we might look? I expect the problem is somewhere in
org.csstudio.swt.rtplot
.The text was updated successfully, but these errors were encountered: