MantisBT - ParaView
View Issue Details
0013225ParaView(No Category)public2012-06-07 11:472013-01-10 20:16
Lawrence 
Sebastien Jourdain 
normalminorhave not tried
closedfixed 
3.14.1 
 
TBD
13225_make_vtkPVDataInformation_more_robust
crash
0013225: Crash Bug/Bad Memory Read in pqQueryDialog (vtkDataObjectTypes::GetClassNameFromTypeId also partly to blame)
When pqQueryDialog::populateSelectionType() is used before the pipeline has been updated a bad memory read occurs in VTK's vtkDataObjectTypes::GetClassNameFromTypeId
because typeId is -1

Steps to reproduce: Create a Wavelet source. Do not click Apply. Select Menu>Find Data. In our Win7 debug build and official 3.14.1 release this causes a crash due to bad memory access.
 
The cause of the crash is that vtkPVDataInformation is not fully initialized (DataSetType is still -1).
which leads to a later bad access:

pqQueryDialog::populateSelectionType()
   if(dataInfo->DataSetTypeIsA("vtkGraph"))
vtkPVDataInformation::DataSetTypeIsA(const char* type)
   if (strcmp(type, this->GetDataSetTypeAsString()) == 0)

which calls GetDataSetTypeAsString with -1
vtkDataObjectTypes::GetClassNameFromTypeId(int type)

There are two bugs here.
First, that vtkDataObjectTypes::GetClassNameFromTypeId's bounds check is incomplete:
 if (type < numClasses)

should be
 if (type >=0 && type < numClasses)
to be more robust and prevent a bad memory access in the subsequent line-
  if (type < numClasses)
    {
    return vtkDataObjectTypesStrings[type];
    }
  else
    {
    return "UnknownClass";
    }

Secondly, on the Paraview side, the dialog should have been more robust when the source info is not yet available.

Best,
Lawrence
No tags attached.
related to 0013150closed Utkarsh Ayachit Simplify "Find Data" dialog 
Issue History
2012-06-07 11:47LawrenceNew Issue
2012-06-20 10:58Utkarsh AyachitRelationship addedrelated to 0013150
2012-11-27 15:02Sebastien JourdainTopic Name => 13225_make_vtkPVDataInformation_more_robust
2012-11-27 15:02Sebastien JourdainStatusbacklog => gatekeeper review
2012-11-27 15:02Sebastien JourdainResolutionopen => fixed
2012-11-27 15:02Sebastien JourdainAssigned To => Sebastien Jourdain
2012-11-28 09:21Sebastien JourdainStatusgatekeeper review => customer review
2012-11-28 09:21Sebastien JourdainNote Added: 0029805
2013-01-10 20:16Alan ScottNote Added: 0030066
2013-01-10 20:16Alan ScottStatuscustomer review => closed

Notes
(0029805)
Sebastien Jourdain   
2012-11-28 09:21   
Merged to master
(0030066)
Alan Scott   
2013-01-10 20:16   
Tested Windows, local server, master.