[vtkusers] Error handler invoked during threaded algorithm causes SIGSEGV

David Cole david.cole at kitware.com
Wed Sep 3 22:50:10 EDT 2008


vtkObject derived objects are not safe to access from multiple threads
simultaneously. And since most of the KWWidgets objects derive from
vtkObject... so the same is true for them.

vtkObject methods will execute on whatever thread you call them on. They are
only guaranteed to work properly if you do all the access in a synchronized
manner, using some sort of mutex mechanism to restrict access to a single
thread at a time.

Best to avoid (*ahem*) stupid programming errors, I guess.

:-)
David


On Sun, Aug 31, 2008 at 12:45 PM, Peter Wainwright <
prw at ceiriog.eclipse.co.uk> wrote:

> Hi,
>
> I have a Python application which handles images. It uses a KWWidgets
> application and main window.  By a stupid programming error (ahem...) I
> triggered an error during rendering.  This caused the program to crash
> out with SIGSEGV.  Examining the core dump (see the attachment) I found
> that VTK/KWWidgets was trying to handle the original error when the
> segfault occurred.
>
> Thread 1 (the thread in which the segfault occurred) was cloned from
> Thread 3 (the main thread).  However, in the cloned thread, winPtr =
> Tk_MainWindow(interp) is NULL.
>
> My questions are:
>
> (1) Is it supposed to be legal to do Tk-related stuff in a thread like
> this (I know many widgets sets are not thread-safe)
>
> and
>
> (2) If this is not legal, why is VTK trying to invoke the error handler
> in the context of the sub-thread?  Should it not somehow pass the error
> back to the main thread for processing?
>
> I am working with recent CVS head versions of VTK and KWWidgets on
> Ubuntu 8.04
>
> Thank you,
>
> Peter Wainwright
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080903/15debd90/attachment.htm>


More information about the vtkusers mailing list