Open felipepolido opened 9 years ago
Alright, I compiled VTK from source in DEBUG mode, and the error message is the following:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff93fff700 (LWP 13376)]
0x00007fffe8ac2d85 in vtkQuadricDecimation2::CollapseEdge (this=0x7fff9406cc20, pt0Id=635, pt1Id=635)
at /home/fpolido/drc_workspace/src/trajopt/src/cloudproc/vtkQuadricDecimation2.cxx:1101
1101 if (pts[j] == pt1Id)
(gdb) bt
#0 0x00007fffe8ac2d85 in vtkQuadricDecimation2::CollapseEdge (this=0x7fff9406cc20, pt0Id=635, pt1Id=635)
at /home/fpolido/drc_workspace/src/trajopt/src/cloudproc/vtkQuadricDecimation2.cxx:1101
#1 0x00007fffe8abeee2 in vtkQuadricDecimation2::RequestData (this=0x7fff9406cc20, inputVector=0x7fff94764da0,
outputVector=0x7fff94795d70)
at /home/fpolido/drc_workspace/src/trajopt/src/cloudproc/vtkQuadricDecimation2.cxx:352
#2 0x00007fffe00b1204 in vtkExecutive::CallAlgorithm(vtkInformation*, int, vtkInformationVector**, vtkInformationVector*) () from /usr/lib/libvtkFiltering.so.5.8
#3 0x00007fffe00a575c in vtkDemandDrivenPipeline::ExecuteData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) () from /usr/lib/libvtkFiltering.so.5.8
#4 0x00007fffe00a879d in vtkDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) () from /usr/lib/libvtkFiltering.so.5.8
#5 0x00007fffe01e4cac in vtkStreamingDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) () from /usr/lib/libvtkFiltering.so.5.8
#6 0x00007fffe00a72a7 in vtkDemandDrivenPipeline::UpdateData(int) () from /usr/lib/libvtkFiltering.so.5.8
#7 0x00007fffe01e6485 in vtkStreamingDemandDrivenPipeline::Update(int) () from /usr/lib/libvtkFiltering.so.5.8
#8 0x00007fffe8aba7fc in cloudproc::quadricSimplifyVTK (in=..., meshDecimationFrac=0.100000001)
at /home/fpolido/drc_workspace/src/trajopt/src/cloudproc/mesh_simplification.cpp:81
#9 0x00007fffee0ed06d in TrajOpt::AtlasTraj::PrepPointCloud (this=0x330b330, cloudPtr=..., trans=...)
at /home/fpolido/drc_workspace/src/trajopt/drc_traj/src/atlas_traj.cpp:597
#10 0x000000000043537a in ConvexDecompLoop ()
at /home/fpolido/drc_workspace/src/trajopt/ros_interface/src/TrajOptNode.cpp:62
#11 0x000000000044a263 in boost::detail::thread_data<void (*)()>::run (this=0x904f540)
at /usr/include/boost/thread/detail/thread.hpp:61
#12 0x00007ffff7020ce9 in thread_proxy () from /usr/lib/libboost_thread.so.1.46.1
#13 0x00007ffff6dfee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#14 0x00007fffed5c131d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#15 0x0000000000000000 in ?? ()
Line 1101 is the IF statement below:
int vtkQuadricDecimation2::CollapseEdge(vtkIdType pt0Id, vtkIdType pt1Id)
{
int j, numDeleted=0;
vtkIdType i, npts, *pts, cellId;
this->Mesh->GetPointCells(pt0Id, this->CollapseCellIds);
for (i = 0; i < this->CollapseCellIds->GetNumberOfIds(); i++)
{
cellId = this->CollapseCellIds->GetId(i);
this->Mesh->GetCellPoints(cellId, npts, pts);
for (j = 0; j < 3; j++)
{
if (pts[j] == pt1Id)
{
this->Mesh->RemoveCellReference(cellId);
this->Mesh->DeleteCell(cellId);
numDeleted++;
}
}
}
I narrowed down to the pts[j] variable returning an Invalid Pointer. So as a quick "hack solution" I wrapped the for loop with an if statement that checks for the pointer validity:
if(NULL !=pts)
{
for (j = 0; j < 3; j++)
{
if (pts[j] == pt1Id)
{
this->Mesh->RemoveCellReference(cellId);
this->Mesh->DeleteCell(cellId);
numDeleted++;
}
}
}
}
This "solved" the problem for me, but it doesn't actually tackle why this->Mesh->GetCellPoints is never initializing the pointer on some edge case.
Best,
Felipe
So this is a bug on vtk side, not ours?
Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.
Oi,
I am running a continuous loop that get the latest point-cloud from a laser sensor and transform it into a mesh. The Point-cloud( input data) is very similar in each loop.
I am using the pcl::MeshQuadricDecimationVTK to decimate most of the mesh. The code works for a few loops, behaving exactly like expected, but after what appears to be a random number of iterations it seg-faults with the following ( from gbd):
Program received signal SIGSEGV, Segmentation fault.
The specific lines in my code are =
For reference, the mesh generation from Point-Cloud is:
The computer is concurrently running a simulator, which hogs a lot of the memory. I am guessing this is an internal memory-leak. I wasn't able to find any similar bugs on the Issue Tracker
Any ideas? And is there any alternative options for the same functionality as MeshQuadricDecimationVTK?
Thanks in advance!
Felipe