[vtkusers] OpenGL2/vtkOpenGLTexture.cxx signal SIGSEGV, Segmentation fault

Aashish Chaudhary aashish.chaudhary at kitware.com
Mon Jan 25 12:42:20 EST 2016


On Mon, Jan 25, 2016 at 12:38 PM, Jorge Perez <josp.jorge at gmail.com> wrote:

> Hello, after investigating the pipeline (the SEGFAULT pushed me to do it)
> I found how to remove the warning. The pipeline which is creating the
> texture is internal to vtkImagePlaneWidget. I could remove the Warning by
> disabling the TextureVisibility until a valid ImageData is set to the
> vtkImagePlaneWidget.
>
> But my concern is related to the SEGFAULT, and I wonder if vtk need to
> check for the NULL value that I mentioned in this thread
>

Yes, that's the fix I was talking about. We can add a check at places to
prevent seg-fault and provide a clear message.

- aashish


> .
>
> best regards,
>
> Jorge
>
> 2016-01-25 17:59 GMT+01:00 Aashish Chaudhary <
> aashish.chaudhary at kitware.com>:
>
>> Are you sure that the pipeline that creates the texture is not broken as
>> said in the warning? Looks like whatever filter / pipeline you are using is
>> not producing the data as it should. And it seems to me that we could be
>> check for null texture object in other methods. If no one else look at it,
>> I will push a fix.
>>
>> - Aashish
>>
>> On Mon, Jan 25, 2016 at 6:00 AM, Jorge Perez <josp.jorge at gmail.com>
>> wrote:
>>
>>> Hello, I have an application which is reaching a SIGSEGV when opengl
>>> backend is OpenGL2 (master branch). I have traced the error and it seems to
>>> be related to this kind of warning:
>>>
>>> Warning: Kitware/vtk.gitlab/Common/ExecutionModel/vtkAlgorithm.cxx, line
>>> 1421
>>> vtkOpenGLTexture (0x17e1620): Attempt to get connection index 0 for
>>> input port 0, which has 0 connections.
>>>
>>> The warning appears with both OpenGL and OpenGL2 backends but with the
>>> OpenGL2 a SIGSEGV is reached.
>>>
>>> The SIGSEGV is because the member vtkOpenGLTexture::TextureObject is
>>> NULL and it can be used in:
>>>
>>>
>>>    - OpenGL2/vtkOpenGLPolyDataMapper
>>>
>>> if (texture)
>>>   {
>>>   tNumComp =
>>>    vtkOpenGLTexture::SafeDownCast(texture)->
>>>       *GetTextureObject()->*GetComponents();
>>>   }
>>>
>>>    - OpenGL2/vtkOpenGL2Texture.cxx
>>>
>>> void vtkOpenGLTexture::CopyTexImage(int x, int y, int width, int height)
>>> {
>>>   this->*TextureObject->*CopyFromFrameBuffer(x, y, x, y, width, height);
>>> }
>>>
>>> void vtkOpenGLTexture::PostRender(vtkRenderer *vtkNotUsed(ren))
>>> {
>>>   this->*TextureObject->*Deactivate();
>>> }
>>>
>>> I see that within there are some pice of code which test for
>>> TextureObject and uses it if it is not NULL, but there are others which do
>>> not do the test for NULL.
>>>
>>> In order to have a quick fix I have initialized  the member
>>> TextureObject to vtkTextureObject::New() instead of the value 0 (at the
>>> constructor vtkOpenGLTexture::vtkOpenGLTexture). That solved the SIGSEGV
>>> for my application but I'm not sure if this could be a the correct solution.
>>>
>>> I can submit a merge request if the change make sense.
>>>
>>> this->TextureObject = vtkTextureObject::New();
>>>
>>> best regards,
>>>
>>> Jorge
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/vtkusers
>>>
>>>
>>
>>
>> --
>>
>>
>>
>> *| Aashish Chaudhary | Technical Leader         | Kitware Inc.
>> *
>> *| http://www.kitware.com/company/team/chaudhary.html
>> <http://www.kitware.com/company/team/chaudhary.html>*
>>
>
>


-- 



*| Aashish Chaudhary | Technical Leader         | Kitware Inc.            *
*| http://www.kitware.com/company/team/chaudhary.html
<http://www.kitware.com/company/team/chaudhary.html>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160125/aaa6230b/attachment.html>


More information about the vtkusers mailing list