View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005341VTK(No Category)public2007-07-13 13:582007-09-18 16:56
ReporterAndreas Gerndt 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005341: BUG in 64bit vtkDataArrayTemplate
DescriptionI am working on a very huge terrain dataset consisting of multiple tiles. I
hit the 32bit limit of point numbers so that I recompiled VTK with the
VTK_USE_64BITS_IDS flag set. Nevertheless, appending data still crashed. The
reason was the usage of an "int" in vtkDataArrayTemplate.txx. Changing it to
vtkIdType fixed this problem.

//----------------------------------------------------------------------------
// Allocate memory for this array. Delete old storage only if necessary.
template <class T>
int vtkDataArrayTemplate<T>::Allocate(vtkIdType sz, vtkIdType)
{
...
    //=========================================
    int newSize = (sz > 0 ? sz : 1);
    //=========================================
    this->Array = (T*)malloc(newSize * sizeof(T));
    if(!this->Array)
      {
      vtkErrorMacro("Unable to allocate " << newSize
                    << " elements of size " << sizeof(T)
                    << " bytes. ");
      return 0;
      }
    this->Size = newSize;
    }

  return 1;
}
//----------------------------------------------------------------------------
TagsNo tags attached.
Project
Type
Attached Files

 Relationships

  Notes
(0008324)
Brad King (developer)
2007-08-01 11:32

Fixed in CVS:

/cvsroot/VTK/VTK/Common/vtkDataArrayTemplate.txx,v <-- vtkDataArrayTemplate.txx
new revision: 1.26; previous revision: 1.25

I'll report this for inclusion in the 5.0 branch.
(0009107)
David Cole (developer)
2007-09-18 16:55

Merged this fix into the VTK-5-0 branch today:

  /cvsroot/VTK/VTK/Common/vtkDataArrayTemplate.txx,v <-- vtkDataArrayTemplate.txx
  new revision: 1.16.4.3; previous revision: 1.16.4.2
(0009108)
David Cole (developer)
2007-09-18 16:56

Re-closing after adding note about merging into VTK-5-0

 Issue History
Date Modified Username Field Change
2007-09-18 16:55 David Cole Status closed => @80@
2007-09-18 16:55 David Cole Note Added: 0009107
2007-09-18 16:56 David Cole Status @80@ => closed
2007-09-18 16:56 David Cole Note Added: 0009108
2011-06-16 13:11 Zack Galbreath Category => (No Category)


Copyright © 2000 - 2018 MantisBT Team