[vtk-developers] [VTK 0013143]: crash due to vtkDataArrayTemplateLookup::SortedArray incorrect state because of vtkDataArrayTemplate<T>::SetVariantValue()

Mantis Bug Tracker mantis at public.kitware.com
Tue May 1 22:04:53 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://vtk.org/Bug/view.php?id=13143 
====================================================================== 
Reported By:                Gopalakrishna Palem
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   13143
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   high
Status:                     backlog
Project:                    TBD 
Type:                       crash 
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2012-05-01 21:04 CDT
Last Modified:              2012-05-01 21:04 CDT
====================================================================== 
Summary:                    crash due to vtkDataArrayTemplateLookup::SortedArray
incorrect state because of vtkDataArrayTemplate<T>::SetVariantValue()
Description: 

The method vtkDataArrayTemplate<T>::SetVariantValue() is missing the
DataElementChanged() method call, leaving its Lookup variable Sorted array in
incorrect state. This is causing a crash(access violation).

There are actually two issues here:

1. vtkDataArrayTemplate<T>::SetVariantValue() changes the value, but does not
update the lookup sorted array. A call to DataElementChanged() should be able to
take care of it.
2. But, the vtkDataArrayTemplate<T>::DataElementChanged() does not take the
updates for SortedArray() into account. Presently its only taking care of
CachedUpdates member. 

To correct issue 1, please add this below line at about line 907 in
Common\vtkDataArrayTemplate.txx file:

        this->Lookup->Rebuild = true;;

The corrected code should look like:

  if (valid)
    {
    this->SetValue(id, toInsert);
    this->Lookup->Rebuild = true;
    }

Also, If DataElementChanged() can be updated to include the SortedArray()
updations into account, then vtkDataArrayTemplate<T>::SetVariantValue() can as
well use the DataElementChanged() as below:
  if (valid)
    {
    this->SetValue(id, toInsert);
    DataElementChanged(id);
    }

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-05-01 21:04 Gopalakrishna PalemNew Issue                                   

2012-05-01 21:04 Gopalakrishna PalemFile Added: bug.jpg                         

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




More information about the vtk-developers mailing list