SCIInstitute / ShapeWorks

ShapeWorks
http://sciinstitute.github.io/ShapeWorks/
Other
104 stars 32 forks source link

Corrupt VTK file causes crash #2048

Open akenmorris opened 1 year ago

akenmorris commented 1 year ago

The attached, corrupt VTK file causes Studio to crash. Instead, we should report an error:

corrupt.vtk.zip

2023-04-13 21:56:55.244 (   4.539s) [         117B326]  vtkPolyDataReader.cxx:249    ERR| vtkPolyDataReader (0x7f8e60f57d80): Unrecognized keyword: 3
[2023-04-13 21:56:55.244] [error] ERROR: In /Users/amorris/sci/shapeworks/dependencies/build/vtk/IO/Legacy/vtkPolyDataReader.cxx, line 249
vtkPolyDataReader (0x7f8e60f57d80): Unrecognized keyword: 3
Thread 33 Crashed:: Thread (pooled)
0   libvtkCommonCore-9.1.9.1.0.dylib           0x11cd65e90 vtkAOSDataArrayTemplate<float>::GetTuple(long long, double*) + 192 (vtkAOSDataArrayTemplate.txx:262)
1   libvtkFiltersCore-9.1.9.1.0.dylib          0x1193c0b15 vtkPoints::GetPoint(long long, double*) + 16 (vtkPoints.h:146) [inlined]
2   libvtkFiltersCore-9.1.9.1.0.dylib          0x1193c0b15 vtkCleanPolyData::RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 6005 (vtkCleanPolyData.cxx:384)
3   libvtkCommonExecutionModel-9.1.9.1.0.dylib         0x1174e2764 vtkExecutive::CallAlgorithm(vtkInformation*, int, vtkInformationVector**, vtkInformationVector*) + 68 (vtkExecutive.cxx:746)
4   libvtkCommonExecutionModel-9.1.9.1.0.dylib         0x1174dd74d vtkDemandDrivenPipeline::ExecuteData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 61 (vtkDemandDrivenPipeline.cxx:462)
5   libvtkCommonExecutionModel-9.1.9.1.0.dylib         0x1174dcf19 vtkDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 1529 (vtkDemandDrivenPipeline.cxx:261)
6   libvtkCommonExecutionModel-9.1.9.1.0.dylib         0x11754ea12 vtkStreamingDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 818
7   libvtkCommonExecutionModel-9.1.9.1.0.dylib         0x11754f016 vtkStreamingDemandDrivenPipeline::Update(int, vtkInformationVector*) + 278 (vtkStreamingDemandDrivenPipeline.cxx:417)
8   ShapeWorksStudio                       0x1075738be shapeworks::Mesh::clean() + 110
9   ShapeWorksStudio                       0x1074dcbc2 shapeworks::MeshGenerator::build_mesh_from_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, float) + 946
10  ShapeWorksStudio                       0x1074dc7b6 shapeworks::MeshGenerator::build_mesh(shapeworks::MeshWorkItem const&) + 118
11  ShapeWorksStudio                       0x10750108e shapeworks::MeshWorker::run() + 46
12  libQt5Core.5.15.4.dylib                0x11c41c3bc 0x11c402000 + 107452