-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RANSAC Example Segmentation Fault on PCL 1.11 #4337
Comments
Could you please run you program once with gdb, once with valgrind? That should tell us where the segfault happens. |
@mmartin4972 BTW your code does not compile (for me) because the template parameters for |
Thanks for the quick response. When I ran valgrind with it the program did not segfault. I included the output from when I ran it. I also ran gdb and the program made it up to line 99 of sac_segmentation.hpp and then segfaulted on the next step. I think that is when it runs "getInliers()". It went into this file when 'seg.segment(*inliers, *coefficients);' was run. Here is the gdb output:
|
Could you also elaborate on what you mean by template parameters for |
You wrote
No, the segfault seems to happen at line 99, in Also: what pcl version do you use exactly? 1.11.0 or 1.11.1? Compiled from source? |
On the code on my computer it does have the template arguments and compiles properly. I must have copied the code over incorrectly some how. I use PCL 1.11.1 compiled from source. I use Eigen 3.3.7 compiled from source. I didn't have another program that uses Eigen, so I copied the sample program from here and ran it with Valgrind and got the following output:
|
Could you try your program with MSAC instead Please try also this example with valgrind. |
Did you compile pcl with C++17 support by any chance? |
Can you print the compiler flags that were used to compile pcl and the compiler flags which are being passed to your downstream application. Call
when building both pcl and your application. |
I had the same problem with PCL 1.11 compiled from source on Ubuntu 18.04. I used the sample unchanged from the website and I get a segfault. |
I just installed PCL 1.11.1 on windows from here: https://github.com/PointCloudLibrary/pcl/releases/tag/pcl-1.11.1 and tried the example here: https://pcl.readthedocs.io/projects/tutorials/en/latest/alignment_prerejective.html#alignment-prerejective I don't get a segfault like on ubuntu, but it doesn't align the clouds.
|
I compile my code with meson, and it doesn't like the VERBOSE=1 argument. I tried compiling the -g3, but no extra output was provided. Do you have any idea as to why my code continues segfaulting? |
I need to see the actual call to the compiler your build system does when building pcl and when building your application which depends on pcl. |
I tried to reproduce your error (Ubuntu 18.04.5, Eigen 3.3.7 self installed, pcl 1.11.1 compiled from source), but was unable to do so. I also found this issue that seems to be related. |
When you tried to reproduce the error did you build with GPU and install CUDA? I feel like that might be part of the problem for me, since when using PCL 1.8 I didn't build the gpu library, but now I am. |
I just came across closed issue #2147 and found the solution to my problem was that I needed to compile with the '-mavx' flag. All is working properly now. Thank you for all of your help! |
I had the same problem as @mmartin4972, on Ubuntu 20.04 with PCL 1.10 and Eigen 3.4 The "-march=native" flag was causing the issue and removing it solves the problem. |
I have the same problem avec I used the options in my cmakelist |
@lcuau Which operating system? Which PCL version? How did you install PCL? Can you post a backtrace of the segfault (with gdb or valgrind)? |
Sorry, I use Ubuntu 20.04.6 LTS, PCL VERSION 1.13.1.99, I installed pcl from source (https://github.com/PointCloudLibrary/pcl/releases/tag/pcl-1.13.1), here is the backtrace from gdb Thread 1 "normal_test" received signal SIGSEGV, Segmentation fault. end my code is simply pcl::SampleConsensusModelPlanepcl::PointXYZRGB::Ptr model_p (new pcl::SampleConsensusModelPlanepcl::PointXYZRGB (cloud)); (with cloud a non empty cloud get from 3D camera) |
@lcuau One possible reason for this is that PCL and your own project are compiled with different C++ standards. Assuming PCL is compiled as C++14 (the default), make sure your own project is also compiled as C++14. Another reason is that the architecture options (sse, avx, march=native) are different when compiling your own project vs when compiling PCL. However, usually CMake should take care to use the same options that were used when PCL was compiled, so I would rather recommend against changing those options manually. |
Alright. Right now I am trying to re-compile pcl and I checked the CMakeList to be sure of the options used. When it will be done I will try to compile my own code. Is it enough to build my code with "target_compile_options(name PUBLIC ${PCL_COMPILE_OPTIONS})" ? Or should I add by hand all the option that I see in the pcl CMakeList in my own CMakeList ? |
OK I am not sure of what did the job but I added the following lines in my CmakeList and it worked ! Thank you a lot set(CMAKE_CXX_STANDARD 14 CACHE STRING "The target C++ standard. PCL requires C++14 or higher.") |
I''m using Ubuntu 18, with CUDA 10.0, and PCL 1.11. My code compiles however whenever I try to run the SAC Segmentation my code segfaults when it segments the cloud. I'm using the same code as from the example in the docs and it continues to segfault. Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: