MantisBT - VTK
View Issue Details
0013143VTK(No Category)public2012-05-01 22:042015-08-28 14:48
Gopalakrishna Palem 
T.J. Corona 
highminorhave not tried
closedfixed 
 
 
TBD
crash
0013143: crash due to vtkDataArrayTemplateLookup::SortedArray incorrect state because of vtkDataArrayTemplate<T>::SetVariantValue()
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);
    }
No tags attached.
related to 0014340closed T.J. Corona vtkGraph FindVertex failure 
jpg bug.jpg (549,664) 2012-05-01 22:04
https://www.vtk.org/Bug/file/9186/bug.jpg
Issue History
2012-05-01 22:04Gopalakrishna PalemNew Issue
2012-05-01 22:04Gopalakrishna PalemFile Added: bug.jpg
2012-05-01 22:05Gopalakrishna PalemNote Added: 0028563
2013-06-24 22:18Dave DeMarleNote Added: 0031034
2014-10-02 14:16Utkarsh AyachitRelationship addedrelated to 0014340
2015-08-13 10:44T.J. CoronaAssigned To => T.J. Corona
2015-08-13 10:44T.J. CoronaDescription Updatedbug_revision_view_page.php?rev_id=1221#r1221
2015-08-28 14:48T.J. CoronaNote Added: 0035096
2015-08-28 14:48T.J. CoronaStatusbacklog => closed
2015-08-28 14:48T.J. CoronaResolutionopen => fixed

Notes
(0028563)
Gopalakrishna Palem   
2012-05-01 22:05   
This is from VTK5.10.0.RC1
(0031034)
Dave DeMarle   
2013-06-24 22:18   
Would you mind submitting:
1) a test case which demonstrates the problem.
2) your updates as a patch under gerrit?
For details on how to do so, see http://www.vtk.org/Wiki/VTK/Git/Develop [^]
Both will simplify automated testing and reviewing.
(0035096)
T.J. Corona   
2015-08-28 14:48   
The vtkDataArrayTemplate has been updated to have safe calls to insert variant values, as of the following commit:

https://gitlab.kitware.com/vtk/vtk/commit/84b126f964763a556da467e643c5aa8cc650611f [^]