MantisBT - ParaView
View Issue Details
0012689ParaView(No Category)public2011-10-31 10:062013-09-03 20:39
len0 
Alan Scott 
normalminorhave not tried
closedfixed 
3.10.1 
 
Release
crash
0012689: Segmentation fault when clipping Polyhedra
Clipping an unstructured grid containing more than one polyhedron (cell type 42) in Paraview 3.10.1 64-bit and 3.12.0-RC2 64-bit yields a segmentation fault. A minimal example containing two tetrahedra is attached as .vtu file. Plane-clipping the grid with a Z-Normal should reproduce the seg. fault.

The crash could also be reproduced with ParaView git/master as follows:
 * Load file
 * Filters - Clip
   Clip Type: Plane
   Origin: 0.3, 0.5, 0.5
   Normal: 1, 0, 0
   Tick "Inside Out" checkbox
   Apply
(One may need to toggle the checkbox a couple of times and pressing
Apply each time after toggling until the segfault gets triggered.)

=> 0x00007fffdf00166a in vtkDataSetSurfaceFilter::InsertPolygonInHash
(this=0x2a09270, ids=0x2bd7cb0, numPts=0, sourceId=0)
    at /opt/ParaView3.git/VTK/Graphics/vtkDataSetSurfaceFilter.cxx:1797
1797 quad = *end;
(gdb) list 1794
1789 vtkIdType* tab = new vtkIdType[numPts];
1790 for(int i=0; i<numPts; i++)
1791 {
1792 tab[i] = ids[(offset+i)%numPts];
1793 }
1794
1795 // Look for existing hex in the hash;
1796 end = this->QuadHash + tab[0];
1797 quad = *end;
(gdb) print numPts
$1 = 0
(gdb) print tab[0]
$1 = -614752568

The segfault is triggered by the variable 'numPts' being zero which
causes the for-loop in line 1790 being skipped such that the array 'tab'
is not initialized, but still queried at position 0 in line 1796. So,
'end' points to some random location in memory and dereferencing it in
line 1797 causes the segfault.
No tags attached.
related to 0014188closed David Thompson Bug on clipping vtkUnstructuredGrid containing Polyhedrons 
? polyh_min.vtu (830) 2011-10-31 10:06
https://www.vtk.org/Bug/file/9052/polyh_min.vtu
Issue History
2011-10-31 10:06len0New Issue
2011-10-31 10:06len0File Added: polyh_min.vtu
2013-08-19 11:58David ThompsonNote Added: 0031486
2013-08-19 11:58David ThompsonRelationship addedrelated to 0014188
2013-08-20 10:39len0Note Added: 0031488
2013-09-03 20:39Alan ScottNote Added: 0031525
2013-09-03 20:39Alan ScottStatusbacklog => closed
2013-09-03 20:39Alan ScottAssigned To => Alan Scott
2013-09-03 20:39Alan ScottResolutionopen => fixed

Notes
(0031486)
David Thompson   
2013-08-19 11:58   
This may be fixed by recent commits. See ParaView bug 14188.
(0031488)
len0   
2013-08-20 10:39   
I confirm that clipping polyhedra now works with git-master on all data sets I have tried (including the above). Thanks!
(0031525)
Alan Scott   
2013-09-03 20:39   
Fixed. See bug 14166 for details.

Tested local server, master, Linux.