Ensight measured data crash paraview.
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Reading ensight gold with measured data in ASCII format crashes paraview while attempting to assign the points:
vtkEnSightGoldReader::ReadMeasuredGeometryFile() { ... vtkDebugMacro("assign points"); geom->SetPoints(newPoints); // CRASH! vtkDebugMacro("assigned points"); newPoints->Delete(); vtkDebugMacro("newPoints->Deleted");
... }
NOTE: in the prev code snippet, I already had to replace the geom->InsertNextCell(VTK_VERTEX, 1, &id);
with vtkCellArray *newCells = vtkCellArray::New(); newCells->Allocate(this->NumberOfMeasuredPoints); ... for (...) { newCells->InsertNextCell(1, &id); }
to avoid another crash.
Reading in binary files fails differently. Here the culprit is apparently from re-using the same block:
Debug: In .../VTK/IO/vtkEnSightGoldBinaryReader.cxx, line 1145 vtkEnSightGoldBinaryReader (0x17b6060): read measured data - add to block
ERROR: In .../VTK/IO/vtkEnSightReader.cxx, line 2145 vtkEnSightGoldBinaryReader (0x17b6060): Block already has a vtkDataSet assigned to it.
Debug: In .../VTK/IO/vtkEnSightGoldBinaryReader.cxx, line 1152 vtkEnSightGoldBinaryReader (0x17b6060): added to block
Looking at the code in vtkEnSightGoldBinaryReader.cxx, line 1150
this->AddToBlock(output, this->NumberOfGeometryParts, pd);
It looks like the last geometry part is getting reused. In the ReadMeasuredGeometryFile() there is no signs of the output dataset being incremented.
The attached cases are a minimal set of data that reproduces the problem.