MantisBT - VTK
View Issue Details
0012756VTK(No Category)public2011-12-01 11:102016-07-06 14:45
Luke Dodd 
Sebastien Jourdain 
normalminorhave not tried
closedno change required 
 
 
TBD
crash
0012756: xcb error with vtkPanel/Canvas on linux
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)
No tags attached.
Issue History
2011-12-01 11:10Luke DoddNew Issue
2011-12-01 11:34Luke DoddNote Added: 0027750
2012-03-02 15:21Jerome RobertNote Added: 0028336
2012-06-15 02:29Jerome RobertNote Added: 0028699
2014-10-02 09:59Berk GeveciAssigned To => Sebastien Jourdain
2016-07-06 14:45Sebastien JourdainNote Added: 0036220
2016-07-06 14:45Sebastien JourdainStatusbacklog => closed
2016-07-06 14:45Sebastien JourdainResolutionopen => no change required

Notes
(0027750)
Luke Dodd   
2011-12-01 11:34   
Just got a not-so-helpful stack trace:

#0 0x00007f22ee4db3a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007f22ee4deb0b in __GI_abort () at abort.c:92
#2 0x00007f22ee4d3d4d in __GI___assert_fail (assertion=0x7f22e72b87a5 "!xcb_xlib_unknown_req_in_deq", file=<optimized out>, line=178,
    function=<optimized out>) at assert.c:81
#3 0x00007f22e7244b79 in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#4 0x00007f22e7245cbc in _XReply () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#5 0x00007f22e722f754 in XInternAtom () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#6 0x00007f22e7783a68 in Java_sun_awt_X11_XlibWrapper_InternAtom () from /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64/xawt/libmawt.so
#7 0x00007f22e978fd6e in ?? ()
#8 0x0000000000000000 in ?? ()


Interestingly there are no vtk calls there.
(0028336)
Jerome Robert   
2012-03-02 15:21   
I reproduce this issue with the nvidia driver but it disappear when I switch to the "nouveau" driver. So unfortunately it seems to be driver related.
(0028699)
Jerome Robert   
2012-06-15 02:29   
Using the -Dsun.java2d.opengl=true flag seems to make the segfault disappear, but make the actors flickering when rotating the scene.
(0036220)
Sebastien Jourdain   
2016-07-06 14:45   
We have JOGL implementation that might solve that issue. Closing it.