-
-
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
Segmentation fault using a custom point type with c++23, clang and libc++, when compiling for 32 bit #6215
Comments
@Jimbopython How did you install PCL? If you compiled it from source, did you change any options or did you use the default ones? |
I am using conan to install PCL. The options in conan are:
Conan settings are:
Toolchain file is:
If this is not enough info for you, i will have to dig into the cmake files conan generates to build PCL.
Eigen Version is 3.4.0
The Cmake command line to build the sample is:
The mentioned toolchain file is the same as previously mentioned to compile PCL with conan.
Output is: 0 16 1 20 |
Due to your very specific build options, I was not (yet) able to reproduce the problem. Eigen has a custom/"handmade" function to allocate and free aligned memory (useful e.g. for SSE). This is used in Please try running you program with valgrind. That should tell us with which function the memory was allocated. And another question: is the |
For this test i linked the runtime dynamically.
The segmentation fault also appears without this line. Specifically. the valgrind output from above is from a binary compiled without this line. |
Perfect, that is the output I was looking for. So This is a really interesting problem. 😄
It seems that only libc++ uses
Why does it work fine if you switch to 64 bit? I mentioned in my last comment that Eigen first checks whether malloc already delivers the desired alignment, based on architecture etc. In your 32 bit test, this was not the case, as shown by I am not sure if there are any work-arounds until
If the point cloud stays at zero points, there is no memory allocated, and no memory has to be freed at the end. I would assume though that the same problem happens with, e.g., reserve. |
For your information: https://gitlab.com/libeigen/eigen/-/issues/2895 |
Describe the bug
When using the example for a custom point type in the pcl documentation and compiling with c++23, clang, libc++ and compiling for 32 bit, i get a segmentation fault. When compiling with c++20 everything works fine. It also works fine, when using c++23, clang and libstdc++. It also always works fine in 64 bit.
To Reproduce
Compile the following example with c++23, clang and libc++ (and -m32):
Screenshots/Code snippets
Your Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: