[vtkusers] Help about a program crash using VTK

Guillaume Jacquenot guillaume.jacquenot at gmail.com
Fri Sep 28 05:31:32 EDT 2012

Dear all,

I have developped a program with use of VTK 5.10 C++ to perform velocity
vector requests in a CFD data file.
I use vtkCellLocator class with method FindCell to identify in which cell I
make my requests.
So far, I have had no problem.
I encounter a first crash with a large input data set (5Go) (Linux 64bits
with 32Go RAM)
The data I use to create is an ensight binary gold file that contains a
The crash occurs on a call to FindCell of vtkCellLocator class.
The method FindCell produces a segmentation fault for one specific request.
The only information about this request I have is that the function crashes
for a point close to the bounding box (close to and inside the bounding
I filter my inputs with a bounding box test to ensure that my requests are
located in the bounding box of my data set.
My function that calls FindCell is given at the end of this post.

I manage to compile the program with a debug version, however I didn't
compile VTK in Debug mode
Here is the gdb log I have
Program received signal SIGSEGV, Segmentation fault.
0x00002aaab15d44a8 in vtkAbstractCellLocator::FindCell (this=0x10f1050,
x=0x7fffffff6790) at
183 }
(gdb) bt
#0 0x00002aaab15d44a8 in vtkAbstractCellLocator::FindCell (this=0x10f1050,
x=0x7fffffff6790) at
#1 0x3fa90f6b63a3ff81 in ?? ()
#2 0x00007fffffff6790 in ?? ()
#3 0x00000000010f1050 in ?? ()
#4 0x00007fffffff67e8 in ?? ()
#5 0x00002aaaae5359d8 in
std::allocator<vtkSmartPointer<vtkCellLocator> > > const&, double const*,
lo ng long&, long long&) () from

On the same dataset, I can also use
vtkCellLocatorInterpolatedVelocityField, to perform my work.
With this class, I have reported no crash. However, I am not sure it makes
the same point requests...

Do you have any advise?
Compile VTK in Debug mode, to trace back the problem?
Any other solution?

Best regards,
Guillaume Jacquenot.

 * \brief returns the block id and cell id of an input point to locate in a
vector of vtkCellLocator
 * \param[in]  vectCellLocator Std vector of a cell locator
 * \param[in]  pointToLocate Point to locate
 * \param[out] idCellLocator Id of the block containing the input point
 * \param[out] idCell Id of the cell containing the input point
 * \return     hasCellBeenFound Boolean indicating that the cell has been
bool findPointLocationFromAVectorOfCellLocator(
        const vtkstd::vector<vtkSmartPointer<vtkCellLocator> > &
        const double pointToLocate[3],
        vtkIdType& idCellLocator,
        vtkIdType& idCell)
    bool hasCellBeenFound = false;
    const int nVector = (int)(vectCellLocator.size());
    idCellLocator = 0;
    idCell = 0;
    while ((hasCellBeenFound==false)&&(idCellLocator<nVector))
        idCell = vectCellLocator.at(idCellLocator)->FindCell(pointToLocate);
        if (idCell!=-1)
            hasCellBeenFound = true;
    return hasCellBeenFound;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120928/49aa00df/attachment.htm>

More information about the vtkusers mailing list