[vtkusers] vtkTkRenderWidget:Linux:Python and VTK threaded:each render spawns zombie

Brent Goodrick bgoodrick at ipns.com
Sat Apr 12 11:13:02 EDT 2003

Hi Donna,

You are building on RH 6.1 and executing on RH 8.0 which is bad news.
GLIBC has changed, name mangling in the compiler has changed,
etc. etc.  I would suggest compiling under the same system
(compiler+libraries+OSrevision) in which you execute on.  

If you are bound and determined to do it, you may try the
compatibility libraries that Red Hat has shipped in the past (RH 7.x
anyhow).  I expect that they would discontinue those libraries at some
point, so that would not be a good long term strategy.

Brent Goodrick
PT Software

>>>>> "donna" == donna  <donna at v1.wustl.edu> writes:

donna> Build environment:
donna> 	Linux RedHat 6.1 (Cartman) 2.2.12-20 (uni-processor)
donna> 	gcc 3.2.2
donna> 	Python 2.1.3
donna> 	VTK cvs co -D "10/5/2002"
donna> 	both python and vtk configured with threads

donna> When I run the following simple python script on a dual processor host
donna> running Linux RedHat 8.0 (Psyche) 2.4.18-26.8.0smp, each render spawns a
donna> zombie python process:

donna> http://pulvinar.wustl.edu/donna/SureFit/Linux/volview.py

donna> (This script is a simplified version of
donna> http://public.kitware.com/cgi-bin/cvsweb.cgi/VTK/Examples/Medical/Python/Medical3.py;
donna> thanks to will and prabhu for making it available.)

donna> Keypress 'i' or 'd' in the image widget (increment or decrement the
donna> slice displayed from VTK_DATA_ROOT + "/Data/headsq/quarter") triggers a
donna> vtkTkRenderWidget render.  Running python in gdb, with several printf
donna> messages inserted into VTK/Common/vtkDataObject.cxx and
donna> VTK/Common/vtkImageData.cxx, produces this output:

donna> *** DISPLAYING slice 30
donna> ...vtkImageData::UpdateData ...
donna> ...vtkDataObject::UpdateData begin...
donna> ...propagate the UpdateData to the source...
...Source-> UpdateData...
donna> ...vtkImageData::UpdateData ...
donna> ...vtkDataObject::UpdateData begin...
donna> ...vtkDataObject::UpdateData end...
donna> ...checking this->UpdateNumberOfPieces == 1 ...
donna> ...confirmed this->UpdateNumberOfPieces == 1 ...
donna> [New Thread 24580 (LWP 668)]
...this-> UpdatePiece...
...this-> UpdateNumberOfPieces...
...this-> UpdateGhostLevel...
donna> ...vtkDataObject::UpdateData end...
donna> ...checking this->UpdateNumberOfPieces == 1 ...
donna> ...confirmed this->UpdateNumberOfPieces == 1 ...

donna> The modified versions of vtkDataObject.cxx and vtkImageData.cxx are here
donna> -- just printf statements added to see where the thread is being
donna> spawned:

donna> http://pulvinar.wustl.edu/donna/SureFit/Linux/vtkDataObject.cxx
donna> http://pulvinar.wustl.edu/donna/SureFit/Linux/vtkImageData.cxx

donna> The thread is being spawned when vtkImageData::UpdateData returns to
donna> vtkDataObject::UpdateData, because this->UpdateNumberOfPieces == 1. 
donna> There seems to be some recursion here.  Can anyone help me understand
donna> why python is spawning a new thread here?  These threads look like this
donna> in ps -efl output:

donna> 044 Z donna     1590  1589  0  75   0    -     0 do_exi 10:59 pts/2   
donna> 00:00:00 [python <defunct>]
donna> 044 Z donna     1591  1589  0  80   0    -     0 do_exi 10:59 pts/2   
donna> 00:00:00 [python <defunct>]
donna> 044 Z donna     1592  1589  0  80   0    -     0 do_exi 10:59 pts/2   
donna> 00:00:00 [python <defunct>]
donna> 044 Z donna     1593  1589  0  76   0    -     0 do_exi 10:59 pts/2   
donna> 00:00:00 [python <defunct>]

donna> They have caused crashes for one user, whose soft maxproc limit is
donna> 1024.  My application has numerous render events, and in his case
donna> several threads are being spawned per render.  When the number of
donna> zombies approaches 1000, my application crashes.  This seems to happen
donna> despite increasing the maxproc limit.  (Python seems to be crashing at
donna> the machine's soft limit, regardless of the user's environment.)

donna> I can rebuild python and vtk without threads, and the user doesn't
donna> crash.  But I'd like to understand why the renders are spawning these
donna> threads.  Any ideas are appreciated.

donna> Thanks,

donna> Donna Hanlon
donna> _______________________________________________
donna> This is the private VTK discussion list. 
donna> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
donna> Follow this link to subscribe/unsubscribe:
donna> http://public.kitware.com/mailman/listinfo/vtkusers

More information about the vtkusers mailing list