[vtkusers] Why does deletion of vtkpolydatamapper cause an infinite loop in vtkclearopenglerrors?

Bill Lorensen bill.lorensen at gmail.com
Tue Nov 11 12:50:07 EST 2014


This was fixed last April and will be in the next release:

commit 4f30bff38137241ecb8cdda89db9948e42f9cba3
Author: Bill Lorensen <bill.lorensen at gmail.com>
Date:   Tue Apr 15 10:37:44 2014 -0400

    COMP: Guard against infinite loop in vtkClearOpenGLErrors

    Some platforms/drivers do not properly clear the error flags after a
    call to glGetError(). This can lead to an infinite loop. This patch
    limits the number of calls to glGetError() to a user provided value or
    a default (16).

    Thanks to Richard Whitehead and Marco Sambin for reporting the
    problem.

    Change-Id: Ie63bec0b47cc6c8047cedf615c4c65f9bcdd30aa

On Tue, Nov 11, 2014 at 12:28 PM, Adam Bruss <abruss at awrcorp.com> wrote:
> We fixed the problem by recompiling VTK with
>
> VTK_REPORT_OPENGL_ERRORS
>
> turned off.
>
> Thanks,
> Adam
>
> -----Original Message-----
> From: Bill Lorensen [mailto:bill.lorensen at gmail.com]
> Sent: Friday, November 7, 2014 3:13 PM
> To: Adam Bruss
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] Why does deletion of vtkpolydatamapper cause an infinite loop in vtkclearopenglerrors?
>
> If you can provide a small compilable example that illustrates the problem, I'm sure someone can help.
>
>
> On Fri, Nov 7, 2014 at 4:04 PM, Adam Bruss <abruss at awrcorp.com> wrote:
>> Hello,
>>
>> We have a WinForms c++/cli CAD based application that uses VTK 6.1.
>> One of the application's features is playing a script which plays back
>> operations the user had previously done interactively. We pop a modal
>> progress form while the script is playing and do the non-ui work of
>> the script in a background thread. Part of the work of the background
>> thread is creating and deleting vtkPolyDataMappers. While the
>> background thread is going and the progress form is showing we need to
>> update a display in the main thread by calling vtkWin32RenderWindowInteractor::Render().
>>
>> We have a timer setup so Render is called every few hundred
>> milliseconds at most in a UserControl::OnPaint event handler. This
>> allows the view to update while the script is playing giving the user feedback.
>>
>> This used to work in VTK 5. But now an infinite loop happens upon
>> deletion of a vtkPolyDataMapper in the background thread. The infinite
>> loop is in
>> vtkClearOpenGLErrors:
>>
>> void vtkClearOpenGLErrors()
>>
>> {
>>
>> while (glGetError()!=GL_NO_ERROR){;}
>>
>> }
>>
>> Inside the vtkpolydatamapper is a vtkOpenGLDisplayListPainter. When
>> this gets deleted by vtkGarbageCollectorImpl::CollectInternal we get
>> stuck in vtkClearOpenGLErrors.
>>
>> Does anyone have experience with VTK and threading that could help? Do
>> you know anything about this? It's only an apparent problem in VTK
>> 6.1. Is it illegal to have the main UI thread calling Render on a
>> vtkWin32RenderWindowInteractor while a background thread is doing
>> deletes on a vtkPolyDataMapper? It isn't a timing issue. I think it
>> might be an OpenGL context issue but not sure how to fix it. The
>> problem does go away if we avoid calling Render on the display while
>> the background thread is going but we'd like to give the user feedback while the script is playing.
>>
>> Thanks,
>>
>> Adam
>>
>>
>>
>>
>> _______________________________________________
>> 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
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers



-- 
Unpaid intern in BillsBasement at noware dot com


More information about the vtkusers mailing list