[vtkusers] Crash in vtkShaderProgram/vtkOpenGLPolyDataMapper
dei
david.ei at novodynamics.com
Fri Apr 15 13:40:57 EDT 2016
I'm attempting to add a VTK 3D mesh viewer to our java app which builds a
triangular mesh from a CAT scan image series. I'm using the VTK-Java
vtkRenderWindowPanel class to embed the VTK viewer into a JTabbedPane of our
app. It works some of the time, but occasionally crashes with an Access
Violation in the unmanaged vtkShaderProgram->FindUniform() function.
I was able to break on a crash in a C++ debugger. It crashes attempting to
dereference a null vtkShaderProgram 'this' pointer. I'm not sure how
FindUniform() could be invoked with a null 'this' pointer? Maybe because
FindUniform() is an inline function? Anyway, I've been able to crawl the
call stack and find out that vtkOpenGLPolyDataMapper contains a "Tris"
object, which has a null 'Program', which eventually ends up as the null
'this' pointer. I haven't yet figured out what a 'Tris' is or how it is
initialized.
I researched the vtkShaderProgram and it seems that it should be managed by
vtkOpenGLPolyDataMapper. I tried updating my NVIDIA video driver but it made
no difference.
I am very new to VTK and don't yet have a grasp of the 'big picture'. I
apologize if these are very newbie questions:
Is there a way to force the initialization of the default
vtkShaderProgram?
Is there a way to check to see that it has been initialized?
What has to occur to initialize it?
Any other suggestions would be welcome.
I should mention that a very simple java app that (no dicom, or CAT image
processing) that uses the same VTK initialization logic seems to be 100%
reliable.
The call stack looks like:
> vtkRenderingOpenGL2-7.0.dll!vtkShaderProgram::FindUniform(const char *
name=0x000007fedd9d4dd8) Line 772 C++
vtkRenderingOpenGL2-7.0.dll!vtkShaderProgram::SetUniformi(const char *
name=0x000007fedd9d4dd8, int i=0) Line 498 C++
vtkRenderingOpenGL2-7.0.dll!vtkOpenGLPolyDataMapper::SetMapperShaderParameters(vtkOpenGLHelper
& cellBO={...}, vtkRenderer * ren=0x00000000538a5980, vtkActor *
actor=0x0000000053975d40) Line 1451 C++
vtkRenderingOpenGL2-7.0.dll!vtkOpenGLPolyDataMapper::UpdateShaders(vtkOpenGLHelper
& cellBO={...}, vtkRenderer * ren=0x00000000538a5980, vtkActor *
actor=0x0000000053975d40) Line 1433 C++
vtkRenderingOpenGL2-7.0.dll!vtkOpenGLPolyDataMapper::RenderPieceDraw(vtkRenderer
* ren=0x00000000538a5980, vtkActor * actor=0x0000000053975d40) Line 2087 C++
vtkRenderingOpenGL2-7.0.dll!vtkOpenGLPolyDataMapper::RenderPiece(vtkRenderer
* ren=0x00000000538a5980, vtkActor * actor=0x0000000053975d40) Line 2240 C++
vtkRenderingCore-7.0.dll!vtkPolyDataMapper::Render(vtkRenderer *
ren=0x00000000538a5980, vtkActor * act=0x0000000053975d40) Line 64 C++
vtkRenderingOpenGL2-7.0.dll!vtkOpenGLActor::Render(vtkRenderer *
ren=0x00000000538a5980, vtkMapper * mapper=0x000000005398a930) Line 86 C++
vtkRenderingCore-7.0.dll!vtkActor::RenderOpaqueGeometry(vtkViewport *
vp=0x00000000538a5980) Line 196 C++
vtkRenderingOpenGL2-7.0.dll!vtkOpenGLRenderer::UpdateGeometry() Line 211
C++
vtkRenderingOpenGL2-7.0.dll!vtkOpenGLRenderer::DeviceRender() Line 159 C++
vtkRenderingCore-7.0.dll!vtkRenderer::Render() Line 317 C++
vtkRenderingCore-7.0.dll!vtkRendererCollection::Render() Line 53 C++
vtkRenderingCore-7.0.dll!vtkRenderWindow::DoStereoRender() Line 775 C++
vtkRenderingCore-7.0.dll!vtkRenderWindow::DoFDRender() Line 743 C++
vtkRenderingCore-7.0.dll!vtkRenderWindow::DoAARender() Line 622 C++
vtkRenderingCore-7.0.dll!vtkRenderWindow::Render() Line 438 C++
vtkRenderingOpenGL2-7.0.dll!vtkOpenGLRenderWindow::Render() Line 600 C++
vtkRenderingCoreJava.dll!Java_vtk_vtkRenderWindow_Render_19(JNIEnv_ *
env=0x000000004d7e79f8, _jobject * obj=0x000000021b00c790) Line 123 C++
0000000021bca86c() Unknown
...
Best Regards,
David Ei
--
View this message in context: http://vtk.1045678.n5.nabble.com/Crash-in-vtkShaderProgram-vtkOpenGLPolyDataMapper-tp5737734.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list