xcb error with vtkPanel/Canvas on linux
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
When a vtkPanel is disposed of often an error like the following is given:
[xcb] Unknown request in queue while dequeuing [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called [xcb] Aborting, sorry about that. java: ../../src/xcb_io.c:178: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
It's fairly non deterministic, but this code seems to reproduce around 50% of the time: https://github.com/lukedodd/lwjgl-vtkcanvas/blob/lwjgl-vtkcanvas/lwjglvtkcanvas/VTKXCBBugReproduce.java
I've seen this issue occur on many different versions of 64 bit Ubuntu, it was present in vtk 5.6, 5.8 and recent git checkouts.
As way around this I created a vtk canvas class that uses LWJGL (a java opengl wrapper) to set up the context and draw to an awt component, and then uses a tweaked vtkGenericOpenGLRenderWindow to have vtk draw to this context. This fixed the issue in my actual program, for the test case, and for someone else.
See this thread for details: http://vtk.1045678.n5.nabble.com/Crashes-in-Java-wrapped-vtk-on-linux-because-of-xcb-problems-td5023093.html
And this github: https://github.com/lukedodd/lwjgl-vtkcanvas Especially the following directory: https://github.com/lukedodd/lwjgl-vtkcanvas/tree/lwjgl-vtkcanvas/lwjglvtkcanvas
(I don't expect any of the code on the git hub to be put into vtk in it's current form, but hopefully it's hepful in pinning down exactly what's going on)