crash writing vtp with degenerate cells (new in vtk9)
In discussions with @jcfr, we decided to post the issue here and flag it as a regression in VTK, since code that used to work (with a warning) now leads to a crash.
this->Cells is null in vtk 9.0.1,
vtkXMLUnstructuredDataWriter crashes with a stack trace like this:
1 std::vector<vtkPolyData_detail::TaggedCellId>::operator stl_vector.h 1043 0x7f3e1ff04516 2 vtkPolyData_detail::CellMap::GetTag vtkPolyDataInternals.h 239 0x7f3e1ff04325 3 vtkPolyData::GetCellType vtkPolyData.h 730 0x7f3e2012759a 4 vtkDataSet::GetCellTypes vtkDataSet.cxx 326 0x7f3e1ff39865 5 vtkXMLUnstructuredDataWriter::ProcessRequest vtkXMLUnstructuredDataWriter.cxx 166 0x7f3e1b31418e 6 vtkExecutive::CallAlgorithm vtkExecutive.cxx 746 0x7f3e1fe25449 7 vtkDemandDrivenPipeline::ExecuteData vtkDemandDrivenPipeline.cxx 462 0x7f3e1fe1cf92 ...
IMO the correct behavior would be to restore the previous option of just printing a warning and continuing. It's not optimal to have degenerate cells in a
vtkPolyData, but it should not lead to a crash, especially since it worked before.