flann-lib / flann

Fast Library for Approximate Nearest Neighbors
http://people.cs.ubc.ca/~mariusm/flann
Other
2.22k stars 647 forks source link

Segmentation Fault Creating KDTreeIndexParams #444

Closed mattangus closed 5 months ago

mattangus commented 4 years ago

I'm getting a seg fault from this line of code:

auto temp = flann::KDTreeIndexParams(4);

Here is the stack trace:

received signal SIGSEGV, Segmentation fault.
0x00007fff23df5616 in flann::any::reset (this=0xdb46330) at ..../flann/src/cpp/flann/util/any.h:263
263         policy->static_delete(&object);
(gdb) bt
#0  0x00007fff23df5616 in flann::any::reset (this=0xdb46330) at ..../flann/src/cpp/flann/util/any.h:263
#1  flann::any::assign<flann::flann_algorithm_t> (this=0xdb46330, x=@0x7fffffffc52c: flann::FLANN_INDEX_KDTREE) at ..../flann/src/cpp/flann/util/any.h:208
#2  0x00007fff23df8386 in flann::any::operator=<flann::flann_algorithm_t> (x=@0x7fffffffc52c: flann::FLANN_INDEX_KDTREE, this=<optimised out>)
    at ..../flann/src/cpp/flann/util/any.h:218
#3  flann::KDTreeIndexParams::KDTreeIndexParams (this=0x7fffffffc5b0, trees=<optimised out>) at ..../flann/src/cpp/flann/algorithms/kdtree_index.h:60

Any ideas what is going wrong?

I will work on making a minimal example and post back here.

PatrickQianKun commented 4 years ago

@mattangus meet the same segmentaion fault when using pcl with kdtree, the stack is almost the same, have you fixed this problem?

mattangus commented 4 years ago

Unfortunately not :(

PatrickQianKun commented 4 years ago

Got stuck in this creepy problem for one week, finally use nanoflann instead. But lots of algorithms in pcl still rely on flann, need help for this bug....