View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014527VTK(No Category)public2014-01-18 11:532014-10-05 14:04
ReporterMichka Popoff 
Assigned ToBill Lorensen 
PriorityhighSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version6.0.0 
Target Version6.2.0Fixed in Version6.2.0 
Summary0014527: Segfault with vtkLoopSubdivisionFilter
DescriptionI am using vtkLoopSubdivisionFilter with Python on OS X. The segfault happens with VTK 6.0.0 and VTK 6.1.0 RC 1.

Here is my code, I added the stl file I use (I exported the polydata I wanted to smooth, so you can reproduce the bug). I also tried with using vtkCleanPolyData before the smoothing; but that does not change anything.

#!/usr/bin/env python

import vtk

filename = "test2.stl"

reader = vtk.vtkSTLReader()
reader.SetFileName(filename)

smooth = vtk.vtkLoopSubdivisionFilter()
smooth.SetNumberOfSubdivisions(2)
smooth.SetInputConnection(reader.GetOutputPort())
smooth.Update()



The error message of the segfault :

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_c.dylib 0x00007fff8bc13b16 small_free_list_remove_ptr + 318
1 libsystem_c.dylib 0x00007fff8bc17c53 szone_free_definite_size + 3495
2 libsystem_c.dylib 0x00007fff8bc50789 free + 194
3 libvtkCommonDataModel-6.0.1.dylib 0x0000000108e65cae vtkEdgeTable::Initialize() + 78
4 libvtkCommonDataModel-6.0.1.dylib 0x0000000108e65ea1 vtkEdgeTable::~vtkEdgeTable() + 25
5 libvtkCommonDataModel-6.0.1.dylib 0x0000000108e65e5f vtkEdgeTable::~vtkEdgeTable() + 15
6 libvtkCommonCore-6.0.1.dylib 0x00000001087cd6dd vtkObject::UnRegisterInternal(vtkObjectBase*, int) + 605
7 libvtkFiltersModeling-6.0.1.dylib 0x000000010c0afd8c vtkLoopSubdivisionFilter::GenerateSubdivisionPoints(vtkPolyData*, vtkIntArray*, vtkPoints*, vtkPointData*) + 782
8 libvtkFiltersGeneral-6.0.1.dylib 0x0000000109a5ef24 vtkApproximatingSubdivisionFilter::RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 1036
9 libvtkFiltersModeling-6.0.1.dylib 0x000000010c0b0752 vtkLoopSubdivisionFilter::RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 728
10 libvtkCommonExecutionModel-6.0.1.dylib 0x000000010924550a vtkExecutive::CallAlgorithm(vtkInformation*, int, vtkInformationVector**, vtkInformationVector*) + 66
11 libvtkCommonExecutionModel-6.0.1.dylib 0x000000010923da6f vtkDemandDrivenPipeline::ExecuteData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 61
12 libvtkCommonExecutionModel-6.0.1.dylib 0x0000000109238134 vtkCompositeDataPipeline::ExecuteData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 564
13 libvtkCommonExecutionModel-6.0.1.dylib 0x000000010923d32f vtkDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 727
14 libvtkCommonExecutionModel-6.0.1.dylib 0x000000010925734d vtkStreamingDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 707
15 libvtkCommonExecutionModel-6.0.1.dylib 0x000000010923d814 vtkDemandDrivenPipeline::UpdateData(int) + 246
16 libvtkCommonExecutionModel-6.0.1.dylib 0x0000000109257797 vtkStreamingDemandDrivenPipeline::Update(int) + 137
17 libvtkCommonExecutionModelPython27D-6.0.1.dylib 0x00000001091a78d9 _ZL21PyvtkAlgorithm_UpdateP7_objectS0_ + 305
18 org.python.python 0x00000001080965ac PyEval_EvalFrameEx + 7873
19 org.python.python 0x00000001080945c1 PyEval_EvalCodeEx + 1638
20 org.python.python 0x0000000108093f55 PyEval_EvalCode + 54
21 org.python.python 0x00000001080b2db4 run_mod + 53
22 org.python.python 0x00000001080b2e5b PyRun_FileExFlags + 137
23 org.python.python 0x00000001080b29a9 PyRun_SimpleFileExFlags + 718
24 org.python.python 0x00000001080c354f Py_Main + 3039
25 org.python.python 0x0000000108011f2c 0x108010000 + 7980
Tagshackaton
ProjectKitware
Typecrash
Attached Files? file icon test.stl [^] (82,784 bytes) 2014-01-18 11:53

 Relationships

  Notes
(0032195)
Michka Popoff (reporter)
2014-01-21 11:25

Oups, filename should be (in the code) : filename = "test.stl"
(0032225)
Michka Popoff (reporter)
2014-01-28 04:27

In fact I was able to trace back this to the following error :

0 libvtkCommonCore-6.0.1.dylib 0x000000010c7db06e vtkDataArrayTemplate<float>::GetTuple(long long, double*) + 30
1 libvtkCommonDataModel-6.0.1.dylib 0x000000010cf74204 vtkPolyData::ComputeBounds() + 384
2 libvtkCommonDataModel-6.0.1.dylib 0x000000010ceac4ea vtkDataSet::GetBounds() + 18
3 libvtkFiltersCore-6.0.1.dylib 0x000000010d4e5933 vtkDecimatePro::RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 753

Which led me to this discussion : http://vtk.1045678.n5.nabble.com/Handling-invalid-vtp-files-td1252488.html [^]

The problem is in my case an ill-formed volume, with some triangles at the same position. I reorganized the way I create/organize my triangles, which fixed it !

I think this is not so easy to solve, there would be a lot of possible checks to put before using the smoothing filters if we want to ensure it does not crash.

For me this is issue is solved, I was able to make it work differently, If you want I can close, or perhaps someone may wish to take a look at this ?
(0033543)
Shawn Waldon (developer)
2014-10-02 16:41
edited on: 2014-10-02 16:46

The issue here was that a non-manifold surface was put into the loop subdivision filter it segfaulted. Bad input data. It is right to have an error, but it shouldn't segfault.

(0033568)
Bill Lorensen (developer)
2014-10-03 09:00

Subdivision filters now check for non-manifold data and report an error.
gerrit patch: http://review.source.kitware.com/#/c/17489/ [^]

 Issue History
Date Modified Username Field Change
2014-01-18 11:53 Michka Popoff New Issue
2014-01-18 11:53 Michka Popoff File Added: test.stl
2014-01-21 11:25 Michka Popoff Note Added: 0032195
2014-01-28 04:27 Michka Popoff Note Added: 0032225
2014-10-01 20:23 Sean McBride Tag Attached: hackaton
2014-10-02 10:01 Shawn Waldon Assigned To => Shawn Waldon
2014-10-02 10:22 Shawn Waldon Note Added: 0033436
2014-10-02 10:22 Shawn Waldon Status backlog => closed
2014-10-02 10:22 Shawn Waldon Resolution open => fixed
2014-10-02 16:41 Shawn Waldon Note Added: 0033543
2014-10-02 16:41 Shawn Waldon Reproducibility have not tried => always
2014-10-02 16:41 Shawn Waldon Status closed => backlog
2014-10-02 16:41 Shawn Waldon Resolution fixed => reopened
2014-10-02 16:41 Shawn Waldon Assigned To Shawn Waldon => Bill Lorensen
2014-10-02 16:45 Shawn Waldon Note Deleted: 0033436
2014-10-02 16:46 Shawn Waldon Note Edited: 0033543
2014-10-03 09:00 Bill Lorensen Note Added: 0033568
2014-10-03 09:01 Bill Lorensen Status backlog => gerrit review
2014-10-03 09:01 Bill Lorensen Fixed in Version => 6.2.0
2014-10-03 09:01 Bill Lorensen Target Version => 6.2.0
2014-10-05 14:04 Bill Lorensen Status gerrit review => closed
2014-10-05 14:04 Bill Lorensen Resolution reopened => fixed


Copyright © 2000 - 2018 MantisBT Team