[vtk-developers] [VTK 0013212]: vtkMaskPoints: bad initialisation of MaximumNumberOfPoints

Mantis Bug Tracker mantis at public.kitware.com
Thu May 31 03:20:54 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://www.vtk.org/Bug/view.php?id=13212 
====================================================================== 
Reported By:                amaclean
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   13212
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   urgent
Status:                     backlog
Project:                    TBD 
Type:                       crash 
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2012-05-31 03:20 EDT
Last Modified:              2012-05-31 03:20 EDT
====================================================================== 
Summary:                    vtkMaskPoints: bad initialisation of
MaximumNumberOfPoints
Description: 
I am using vtk 6.0

MaximumNumberOfPoints is being initialised to VTK_LARGE_ID, this should be
initialised to VTK_LARGE_INT instead. See line 36 of vtkMaskPoints.cxx.
Also VTK_LARGE_ID should be changed to VTK_LARGE_INT in the clamp macros at
lines 49, 54 in vtkMaskPoints.h

Rationale:
This code will crash in Python:
mask.SetInputConnection(parametricFunctionSource.GetOutputPort())
print vtk.VTK_LARGE_ID, vtk.VTK_LARGE_INTEGER
print mask.GetMaximumNumberOfPoints()
#mask.SetMaximumNumberOfPoints(100)
mask.RandomModeOn()

with the error:
ERROR: In
c:\users\amaclean\code\kitware\src\vtk\common\core\vtkDataArrayTemplate.txx,
line 144
vtkFloatArray (000000000278C110): Unable to allocate 9223372036854775805
elements of size 4 bytes. 

Obviously uncommenting:
#mask.SetMaximumNumberOfPoints(100)
will fix this.

This issue probably only arises in 64-bit systems.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-05-31 03:20 amaclean       New Issue                                    
======================================================================




More information about the vtk-developers mailing list