MantisBT - VTK
View Issue Details
0011515VTK(No Category)public2010-11-24 18:072012-12-12 12:06
David Gobbi 
David Gobbi 
lowcrashalways
closedfixed 
 
5.10.0 
0011515: Pipeline crashes with multiple update extent requests, if different extents are requested
When the vtkStreamingDemandDrivenPipeline receives update extent requests from more than one downstream algorithm, the extent from the final request is used, even though it may be smaller than the extent from other requests. This can lead to a segfault when the final extent is smaller than the extent required by some of the downstream algorithms.
Run the following tcl example. It will give the following error (assuming a 2-CPU machine) and then crash. I'm guessing that on a 1-CPU machine, it will crash without giving the error.

ERROR: In /Volumes/Work/Kitware/vtk-git/Filtering/vtkImageData.cxx, line 1472
vtkImageData (0x10630fe10): GetScalarPointer: Pixel (0, 128, 0) not in memory.
 Current extent= (0, 127, 0, 127, 0, 0)

===========
package require vtk

# Simple example that crashes when an UpdateExtent request
# from one algorithm is overwritten by a smaller UpdateExtent
# request from another algorithm

# read an image that has an extent of 0 255 0 255 0 0
vtkPNGReader reader
reader SetDataSpacing 0.8 0.8 1.5
reader SetFileName "$VTK_DATA_ROOT/Data/fullhead15.png"

# Uncomment this to make the crash disappear
#reader Update

# clip the image down to 0 127 0 127 0 0
vtkImageClip clip
clip SetInputConnection [reader GetOutputPort]
clip SetOutputWholeExtent 0 127 0 127 0 0

# do an operation on the clipped and unclipped data
vtkImageBlend blend
blend SetInputConnection [reader GetOutputPort]
blend AddInputConnection [clip GetOutputPort]

vtkImageViewer viewer
viewer SetInputConnection [blend GetOutputPort]
viewer SetColorWindow 2000
viewer SetColorLevel 1000
viewer Render
Assigned to myself, because it has been bugging me (hah!) so I've been thinking about it on and off.

One fix would be to add another information key, called COMBINED_UPDATE_EXTENT, that is the union of all update extent requests from all downstream algorithms. Every time an algorithm received REQUEST_UPDATE_EXTENT, it would combine the requested update extent with COMBINED_UPDATE_EXTENT. Then, in REQUEST_DATA (i.e. at the end of the update cycle), the COMBINED_UPDATE_EXTENT would be cleared.

This solution would be specific to 3D extents, i.e. structured data sets like vtkImageData.

Here is a patch that implements the solution described above:
http://review.source.kitware.com/446 [^]
No tags attached.
Issue History
2010-11-24 18:07David GobbiNew Issue
2010-11-24 18:10David GobbiSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=29#r29
2010-11-24 18:11David GobbiCategoryDevelopment => (No Category)
2010-11-24 18:13David GobbiSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=30#r30
2010-11-26 11:46David GobbiAssigned To => David Gobbi
2010-11-26 11:46David GobbiStatusbacklog => tabled
2010-11-26 12:06David GobbiAdditional Information Updatedbug_revision_view_page.php?rev_id=32#r32
2010-11-26 12:42David GobbiAdditional Information Updatedbug_revision_view_page.php?rev_id=33#r33
2010-11-26 17:53David GobbiNote Added: 0023559
2010-11-26 18:04David GobbiAdditional Information Updatedbug_revision_view_page.php?rev_id=36#r36
2010-11-26 18:20David GobbiNote Deleted: 0023559
2010-11-26 18:21David GobbiAdditional Information Updatedbug_revision_view_page.php?rev_id=37#r37
2011-02-25 21:26David GobbiStatustabled => @80@
2011-02-25 21:26David GobbiResolutionopen => fixed
2012-12-12 12:06David GobbiNote Added: 0029876
2012-12-12 12:06David GobbiStatuscustomer review => closed
2012-12-12 12:06David GobbiFixed in Version => 5.10.0

Notes
(0029876)
David Gobbi   
2012-12-12 12:06   
Patch was merged on Feb 25, 2011.