Segfaults in eigen's handmade_aligned_free on ubuntu artful

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Segfaults in eigen's handmade_aligned_free on ubuntu artful

Frank Dekervel
Hello,

I am not able to do anything useful with the pcl packages on ubuntu artful aardvark. The ones on zesty/older work fine (so as a work around i run everything in docker containers).

I get crashes, always on destructors of PCL objects in eigen handmade_aligned_free function.

I made a minimal test case (source below)  that does nothing interesting on zesty, but crashes on aardvark. Note it's not only the IntegralImageNormalEstimation that crashes, a lot of code does, i just took that one for the testcase. Interestingly, the supplied pcl-tools in artful seem to work fine.

I got a similar error on zesty when i (by accident) put -std=c++11 in CMakeLists (https://pastebin.com/KNtkPAwi) , but here i verified and there no -std option defined.

With the following backtrace (see below). Valgrind doesn't crash but gives a warning at the same location (see below).
Does somebody know how to debug this ? Or is this more a question for the Eigen mailinglist ? 

Thanks in advance!
Greetings,
Frank



(gdb) bt
#0  __GI___libc_free (mem=0x101) at malloc.c:3123
#1  0x000055555557a17a in Eigen::internal::handmade_aligned_free (ptr=0x555555897c50) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:98
#2  0x000055555557a1d6 in Eigen::internal::aligned_free (ptr=0x555555897c50) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:179
#3  0x000055555557a753 in Eigen::internal::conditional_aligned_free<true> (ptr=0x555555897c50) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:230
#4  0x000055555557e69d in pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>::operator delete (ptr=0x555555897c50) at /usr/include/pcl-1.8/pcl/search/organized.h:276
#5  0x0000555555582d00 in pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>::~OrganizedNeighbor (this=0x555555897c50, __in_chrg=<optimized out>) at /usr/include/pcl-1.8/pcl/search/organized.h:100
#6  0x00005555555824dd in boost::checked_delete<pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA> > (x=0x555555897c50) at /usr/include/boost/core/checked_delete.hpp:34
#7  0x0000555555585338 in boost::detail::sp_counted_impl_p<pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA> >::dispose (this=0x555555897d50) at /usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:78
#8  0x00007ffff62fd7aa in pcl::IntegralImageNormalEstimation<pcl::PointXYZRGBA, pcl::Normal>::~IntegralImageNormalEstimation() () from /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.8
#9  0x0000555555579edd in main (argc=1, argv=0x7fffffffded8) at /home/kervel/projects/kinectdemo/crashdemo/src/crasher.cpp:15

kervel@kervel-XPS-13-9360:~/projects/kinectdemo/crashdemo/h$ valgrind ./crasher 
==11883== Memcheck, a memory error detector
==11883== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==11883== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==11883== Command: ./crasher
==11883== 
==11883== Invalid read of size 8
==11883==    at 0x12E16F: Eigen::internal::handmade_aligned_free(void*) (Memory.h:98)
==11883==    by 0x12E1D5: Eigen::internal::aligned_free(void*) (Memory.h:179)
==11883==    by 0x12E752: void Eigen::internal::conditional_aligned_free<true>(void*) (Memory.h:230)
==11883==    by 0x13269C: pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>::operator delete(void*) (organized.h:276)
==11883==    by 0x136CFF: pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>::~OrganizedNeighbor() (organized.h:100)
==11883==    by 0x1364DC: void boost::checked_delete<pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA> >(pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>*) (checked_delete.hpp:34)
==11883==    by 0x139337: boost::detail::sp_counted_impl_p<pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA> >::dispose() (sp_counted_impl.hpp:78)
==11883==    by 0x66567A9: pcl::IntegralImageNormalEstimation<pcl::PointXYZRGBA, pcl::Normal>::~IntegralImageNormalEstimation() (in /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.8.1)
==11883==    by 0x12DEDC: main (crasher.cpp:15)
==11883==  Address 0xc9dd088 is 8 bytes before a block of size 240 alloc'd
==11883==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11883==    by 0x6133008: Eigen::internal::aligned_malloc(unsigned long) (in /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.8.1)
==11883==    by 0x64F2A69: pcl::Feature<pcl::PointXYZRGBA, pcl::Normal>::initCompute() (in /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.8.1)
==11883==    by 0x12F4D7: pcl::Feature<pcl::PointXYZRGBA, pcl::Normal>::compute(pcl::PointCloud<pcl::Normal>&) (feature.hpp:191)
==11883==    by 0x12DEAF: main (crasher.cpp:33)
==11883== 
==11883== 
==11883== HEAP SUMMARY:
==11883==     in use at exit: 248 bytes in 2 blocks
==11883==   total heap usage: 379 allocs, 377 frees, 2,507,683 bytes allocated
==11883== 
==11883== LEAK SUMMARY:
==11883==    definitely lost: 240 bytes in 1 blocks
==11883==    indirectly lost: 0 bytes in 0 blocks
==11883==      possibly lost: 0 bytes in 0 blocks
==11883==    still reachable: 8 bytes in 1 blocks
==11883==         suppressed: 0 bytes in 0 blocks
==11883== Rerun with --leak-check=full to see details of leaked memory
==11883== 
==11883== For counts of detected and suppressed errors, rerun with: -v
==11883== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)


The source code:

#include <vector>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/features/integral_image_normal.h>


typedef pcl::PointXYZRGBA T;


int main(int argc, char **argv) {
pcl::PointCloud<pcl::Label> labelCloud;
pcl::Label l;
pcl::IntegralImageNormalEstimation<T, pcl::Normal> ne;
labelCloud.points.push_back(l);
pcl::PointCloud<T>::Ptr otherCloud (new pcl::PointCloud<T>());
pcl::PointCloud<pcl::Normal> normals;
T x;
int rowSize = 100;
int colSize = 100;
for (int row = 0; row<rowSize; row++) {
for (int column=0; column<colSize; column++) {
x.x = row;
x.y = column;
x.z = 6;
otherCloud->points.push_back(x);
}
}
otherCloud->height = rowSize;
otherCloud->width = colSize;
ne.setInputCloud(otherCloud);
ne.compute(normals);
}



_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Segfaults in eigen's handmade_aligned_free on ubuntu artful

Sérgio Agostinho

Hey Frank,

The first big test to do is to know if you get the same errors when you compile the lib by yourself? We're currently about to merge a PR that causes symptoms very close to what you describe. https://github.com/PointCloudLibrary/pcl/pull/2100

I was able to verify that if the SSE flags used while compiling pcl are not the same in the downstream project (which links against pcl) this causes random segfaults. Check for instance https://github.com/PointCloudLibrary/pcl/issues/2013

Heads up, once the PR is merged, only the versions onwards will have the fix. We don't backport fixes.

Cheers


On 29-11-2017 19:22, Frank Dekervel wrote:
Hello,

I am not able to do anything useful with the pcl packages on ubuntu artful aardvark. The ones on zesty/older work fine (so as a work around i run everything in docker containers).

I get crashes, always on destructors of PCL objects in eigen handmade_aligned_free function.

I made a minimal test case (source below)  that does nothing interesting on zesty, but crashes on aardvark. Note it's not only the IntegralImageNormalEstimation that crashes, a lot of code does, i just took that one for the testcase. Interestingly, the supplied pcl-tools in artful seem to work fine.

I got a similar error on zesty when i (by accident) put -std=c++11 in CMakeLists (https://pastebin.com/KNtkPAwi) , but here i verified and there no -std option defined.

With the following backtrace (see below). Valgrind doesn't crash but gives a warning at the same location (see below).
Does somebody know how to debug this ? Or is this more a question for the Eigen mailinglist ? 

Thanks in advance!
Greetings,
Frank



(gdb) bt
#0  __GI___libc_free (mem=0x101) at malloc.c:3123
#1  0x000055555557a17a in Eigen::internal::handmade_aligned_free (ptr=0x555555897c50) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:98
#2  0x000055555557a1d6 in Eigen::internal::aligned_free (ptr=0x555555897c50) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:179
#3  0x000055555557a753 in Eigen::internal::conditional_aligned_free<true> (ptr=0x555555897c50) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:230
#4  0x000055555557e69d in pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>::operator delete (ptr=0x555555897c50) at /usr/include/pcl-1.8/pcl/search/organized.h:276
#5  0x0000555555582d00 in pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>::~OrganizedNeighbor (this=0x555555897c50, __in_chrg=<optimized out>) at /usr/include/pcl-1.8/pcl/search/organized.h:100
#6  0x00005555555824dd in boost::checked_delete<pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA> > (x=0x555555897c50) at /usr/include/boost/core/checked_delete.hpp:34
#7  0x0000555555585338 in boost::detail::sp_counted_impl_p<pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA> >::dispose (this=0x555555897d50) at /usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:78
#8  0x00007ffff62fd7aa in pcl::IntegralImageNormalEstimation<pcl::PointXYZRGBA, pcl::Normal>::~IntegralImageNormalEstimation() () from /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.8
#9  0x0000555555579edd in main (argc=1, argv=0x7fffffffded8) at /home/kervel/projects/kinectdemo/crashdemo/src/crasher.cpp:15

kervel@kervel-XPS-13-9360:~/projects/kinectdemo/crashdemo/h$ valgrind ./crasher 
==11883== Memcheck, a memory error detector
==11883== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==11883== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==11883== Command: ./crasher
==11883== 
==11883== Invalid read of size 8
==11883==    at 0x12E16F: Eigen::internal::handmade_aligned_free(void*) (Memory.h:98)
==11883==    by 0x12E1D5: Eigen::internal::aligned_free(void*) (Memory.h:179)
==11883==    by 0x12E752: void Eigen::internal::conditional_aligned_free<true>(void*) (Memory.h:230)
==11883==    by 0x13269C: pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>::operator delete(void*) (organized.h:276)
==11883==    by 0x136CFF: pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>::~OrganizedNeighbor() (organized.h:100)
==11883==    by 0x1364DC: void boost::checked_delete<pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA> >(pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>*) (checked_delete.hpp:34)
==11883==    by 0x139337: boost::detail::sp_counted_impl_p<pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA> >::dispose() (sp_counted_impl.hpp:78)
==11883==    by 0x66567A9: pcl::IntegralImageNormalEstimation<pcl::PointXYZRGBA, pcl::Normal>::~IntegralImageNormalEstimation() (in /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.8.1)
==11883==    by 0x12DEDC: main (crasher.cpp:15)
==11883==  Address 0xc9dd088 is 8 bytes before a block of size 240 alloc'd
==11883==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11883==    by 0x6133008: Eigen::internal::aligned_malloc(unsigned long) (in /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.8.1)
==11883==    by 0x64F2A69: pcl::Feature<pcl::PointXYZRGBA, pcl::Normal>::initCompute() (in /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.8.1)
==11883==    by 0x12F4D7: pcl::Feature<pcl::PointXYZRGBA, pcl::Normal>::compute(pcl::PointCloud<pcl::Normal>&) (feature.hpp:191)
==11883==    by 0x12DEAF: main (crasher.cpp:33)
==11883== 
==11883== 
==11883== HEAP SUMMARY:
==11883==     in use at exit: 248 bytes in 2 blocks
==11883==   total heap usage: 379 allocs, 377 frees, 2,507,683 bytes allocated
==11883== 
==11883== LEAK SUMMARY:
==11883==    definitely lost: 240 bytes in 1 blocks
==11883==    indirectly lost: 0 bytes in 0 blocks
==11883==      possibly lost: 0 bytes in 0 blocks
==11883==    still reachable: 8 bytes in 1 blocks
==11883==         suppressed: 0 bytes in 0 blocks
==11883== Rerun with --leak-check=full to see details of leaked memory
==11883== 
==11883== For counts of detected and suppressed errors, rerun with: -v
==11883== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)


The source code:

#include <vector>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/features/integral_image_normal.h>


typedef pcl::PointXYZRGBA T;


int main(int argc, char **argv) {
pcl::PointCloud<pcl::Label> labelCloud;
pcl::Label l;
pcl::IntegralImageNormalEstimation<T, pcl::Normal> ne;
labelCloud.points.push_back(l);
pcl::PointCloud<T>::Ptr otherCloud (new pcl::PointCloud<T>());
pcl::PointCloud<pcl::Normal> normals;
T x;
int rowSize = 100;
int colSize = 100;
for (int row = 0; row<rowSize; row++) {
for (int column=0; column<colSize; column++) {
x.x = row;
x.y = column;
x.z = 6;
otherCloud->points.push_back(x);
}
}
otherCloud->height = rowSize;
otherCloud->width = colSize;
ne.setInputCloud(otherCloud);
ne.compute(normals);
}




_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Segfaults in eigen's handmade_aligned_free on ubuntu artful

Frank Dekervel
Hello,

I just finished compiling PCL from source (release build, checkout tag 1.8.1) and there there i have no crash. I wonder if i can go deeper in finding the cause and making a bug report against ubuntu. 

Wrt the pull request: i saw '-march=native' in the GCC command line. if i understand correctly, it will tweak the flags based on which system the compile is done on. And if i understand the pull request correctly, changing the architecture flags can cause ABI issues ? Isn't it a bug that having different arch flags causes ABI incompatibilities ?

Greetings,
Frank









On Wed, Nov 29, 2017 at 8:29 PM, Sérgio Agostinho <[hidden email]> wrote:

Hey Frank,

The first big test to do is to know if you get the same errors when you compile the lib by yourself? We're currently about to merge a PR that causes symptoms very close to what you describe. https://github.com/PointCloudLibrary/pcl/pull/2100

I was able to verify that if the SSE flags used while compiling pcl are not the same in the downstream project (which links against pcl) this causes random segfaults. Check for instance https://github.com/PointCloudLibrary/pcl/issues/2013

Heads up, once the PR is merged, only the versions onwards will have the fix. We don't backport fixes.

Cheers


On 29-11-2017 19:22, Frank Dekervel wrote:
Hello,

I am not able to do anything useful with the pcl packages on ubuntu artful aardvark. The ones on zesty/older work fine (so as a work around i run everything in docker containers).

I get crashes, always on destructors of PCL objects in eigen handmade_aligned_free function.

I made a minimal test case (source below)  that does nothing interesting on zesty, but crashes on aardvark. Note it's not only the IntegralImageNormalEstimation that crashes, a lot of code does, i just took that one for the testcase. Interestingly, the supplied pcl-tools in artful seem to work fine.

I got a similar error on zesty when i (by accident) put -std=c++11 in CMakeLists (https://pastebin.com/KNtkPAwi) , but here i verified and there no -std option defined.

With the following backtrace (see below). Valgrind doesn't crash but gives a warning at the same location (see below).
Does somebody know how to debug this ? Or is this more a question for the Eigen mailinglist ? 

Thanks in advance!
Greetings,
Frank



(gdb) bt
#0  __GI___libc_free (mem=0x101) at malloc.c:3123
#1  0x000055555557a17a in Eigen::internal::handmade_aligned_free (ptr=0x555555897c50) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:98
#2  0x000055555557a1d6 in Eigen::internal::aligned_free (ptr=0x555555897c50) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:179
#3  0x000055555557a753 in Eigen::internal::conditional_aligned_free<true> (ptr=0x555555897c50) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:230
#4  0x000055555557e69d in pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>::operator delete (ptr=0x555555897c50) at /usr/include/pcl-1.8/pcl/search/organized.h:276
#5  0x0000555555582d00 in pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>::~OrganizedNeighbor (this=0x555555897c50, __in_chrg=<optimized out>) at /usr/include/pcl-1.8/pcl/search/organized.h:100
#6  0x00005555555824dd in boost::checked_delete<pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA> > (x=0x555555897c50) at /usr/include/boost/core/checked_delete.hpp:34
#7  0x0000555555585338 in boost::detail::sp_counted_impl_p<pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA> >::dispose (this=0x555555897d50) at /usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:78
#8  0x00007ffff62fd7aa in pcl::IntegralImageNormalEstimation<pcl::PointXYZRGBA, pcl::Normal>::~IntegralImageNormalEstimation() () from /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.8
#9  0x0000555555579edd in main (argc=1, argv=0x7fffffffded8) at /home/kervel/projects/kinectdemo/crashdemo/src/crasher.cpp:15

kervel@kervel-XPS-13-9360:~/projects/kinectdemo/crashdemo/h$ valgrind ./crasher 
==11883== Memcheck, a memory error detector
==11883== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==11883== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==11883== Command: ./crasher
==11883== 
==11883== Invalid read of size 8
==11883==    at 0x12E16F: Eigen::internal::handmade_aligned_free(void*) (Memory.h:98)
==11883==    by 0x12E1D5: Eigen::internal::aligned_free(void*) (Memory.h:179)
==11883==    by 0x12E752: void Eigen::internal::conditional_aligned_free<true>(void*) (Memory.h:230)
==11883==    by 0x13269C: pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>::operator delete(void*) (organized.h:276)
==11883==    by 0x136CFF: pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>::~OrganizedNeighbor() (organized.h:100)
==11883==    by 0x1364DC: void boost::checked_delete<pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA> >(pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA>*) (checked_delete.hpp:34)
==11883==    by 0x139337: boost::detail::sp_counted_impl_p<pcl::search::OrganizedNeighbor<pcl::PointXYZRGBA> >::dispose() (sp_counted_impl.hpp:78)
==11883==    by 0x66567A9: pcl::IntegralImageNormalEstimation<pcl::PointXYZRGBA, pcl::Normal>::~IntegralImageNormalEstimation() (in /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.8.1)
==11883==    by 0x12DEDC: main (crasher.cpp:15)
==11883==  Address 0xc9dd088 is 8 bytes before a block of size 240 alloc'd
==11883==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11883==    by 0x6133008: Eigen::internal::aligned_malloc(unsigned long) (in /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.8.1)
==11883==    by 0x64F2A69: pcl::Feature<pcl::PointXYZRGBA, pcl::Normal>::initCompute() (in /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.8.1)
==11883==    by 0x12F4D7: pcl::Feature<pcl::PointXYZRGBA, pcl::Normal>::compute(pcl::PointCloud<pcl::Normal>&) (feature.hpp:191)
==11883==    by 0x12DEAF: main (crasher.cpp:33)
==11883== 
==11883== 
==11883== HEAP SUMMARY:
==11883==     in use at exit: 248 bytes in 2 blocks
==11883==   total heap usage: 379 allocs, 377 frees, 2,507,683 bytes allocated
==11883== 
==11883== LEAK SUMMARY:
==11883==    definitely lost: 240 bytes in 1 blocks
==11883==    indirectly lost: 0 bytes in 0 blocks
==11883==      possibly lost: 0 bytes in 0 blocks
==11883==    still reachable: 8 bytes in 1 blocks
==11883==         suppressed: 0 bytes in 0 blocks
==11883== Rerun with --leak-check=full to see details of leaked memory
==11883== 
==11883== For counts of detected and suppressed errors, rerun with: -v
==11883== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)


The source code:

#include <vector>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/features/integral_image_normal.h>


typedef pcl::PointXYZRGBA T;


int main(int argc, char **argv) {
pcl::PointCloud<pcl::Label> labelCloud;
pcl::Label l;
pcl::IntegralImageNormalEstimation<T, pcl::Normal> ne;
labelCloud.points.push_back(l);
pcl::PointCloud<T>::Ptr otherCloud (new pcl::PointCloud<T>());
pcl::PointCloud<pcl::Normal> normals;
T x;
int rowSize = 100;
int colSize = 100;
for (int row = 0; row<rowSize; row++) {
for (int column=0; column<colSize; column++) {
x.x = row;
x.y = column;
x.z = 6;
otherCloud->points.push_back(x);
}
}
otherCloud->height = rowSize;
otherCloud->width = colSize;
ne.setInputCloud(otherCloud);
ne.compute(normals);
}




_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users



_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Segfaults in eigen's handmade_aligned_free on ubuntu artful

Sérgio Agostinho

> I just finished compiling PCL from source (release build, checkout tag
> 1.8.1) and there there i have no crash. I wonder if i can go deeper in
> finding the cause and making a bug report against ubuntu.
Ubuntu incorporates packages from the Debian pipeline, so the error
might even be upstream. Jochen is the go-to guy in these situations,
since he's a maintainer for the package in Debian. He should be able to
provide more info.

> Wrt the pull request: i saw '-march=native' in the GCC command line.
> if i understand correctly, it will tweak the flags based on which
> system the compile is done on.
Exactly. If the PCL_ENABLE_SSE is set to ON during the build stage (and
it comes like that by default), we test which SSE/AVX flags your system
supports and pass them to the compiler. Eigen is fully optimized for
them and we make use of that.

> And if i understand the pull request correctly, changing the
> architecture flags can cause ABI issues ?
Exactly.

> Isn't it a bug that having different arch flags causes ABI
> incompatibilities ?
So from our (PCL) side, we need to make sure that we pass the compiler
flags used during compilation, to projects downstream. That's what that
PR is addressing.

Regarding the packaging done in Debian, I would assume they would
compile and package things with PCL_ENABLE_SSE set to OFF, but I'm not
familiar with the process.

Cheers
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Segfaults in eigen's handmade_aligned_free on ubuntu artful

Frank Dekervel
Hello,

i compiled my program by hand and i removed the following flags from gcc:

  -march=native

and the program did not crash anymore.

removing the following options did not have any effect:
 -msse4.1 -mfpmath=sse

is there a way to tell CMake not to put '-march=native' ? i tried CMAKE_CXX_FLAGS in all different places in the CMakeLists.txt but CMake always adds its -march=native after my options...

greetings,
Frank



On Thu, Nov 30, 2017 at 12:01 AM, Sérgio Agostinho <[hidden email]> wrote:

I just finished compiling PCL from source (release build, checkout tag 1.8.1) and there there i have no crash. I wonder if i can go deeper in finding the cause and making a bug report against ubuntu.
Ubuntu incorporates packages from the Debian pipeline, so the error might even be upstream. Jochen is the go-to guy in these situations, since he's a maintainer for the package in Debian. He should be able to provide more info.

Wrt the pull request: i saw '-march=native' in the GCC command line. if i understand correctly, it will tweak the flags based on which system the compile is done on.
Exactly. If the PCL_ENABLE_SSE is set to ON during the build stage (and it comes like that by default), we test which SSE/AVX flags your system supports and pass them to the compiler. Eigen is fully optimized for them and we make use of that.

And if i understand the pull request correctly, changing the architecture flags can cause ABI issues ?
Exactly.

Isn't it a bug that having different arch flags causes ABI incompatibilities ?
So from our (PCL) side, we need to make sure that we pass the compiler flags used during compilation, to projects downstream. That's what that PR is addressing.

Regarding the packaging done in Debian, I would assume they would compile and package things with PCL_ENABLE_SSE set to OFF, but I'm not familiar with the process.

Cheers


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Segfaults in eigen's handmade_aligned_free on ubuntu artful

Sérgio Agostinho

Pass PCL_ENABLE_SSE as off.


cmake <path> -DPCL_ENABLE_SSE=OFF


Cheers


On 30-11-2017 10:22, Frank Dekervel wrote:
Hello,

i compiled my program by hand and i removed the following flags from gcc:

  -march=native

and the program did not crash anymore.

removing the following options did not have any effect:
 -msse4.1 -mfpmath=sse

is there a way to tell CMake not to put '-march=native' ? i tried CMAKE_CXX_FLAGS in all different places in the CMakeLists.txt but CMake always adds its -march=native after my options...

greetings,
Frank



On Thu, Nov 30, 2017 at 12:01 AM, Sérgio Agostinho <[hidden email]> wrote:

I just finished compiling PCL from source (release build, checkout tag 1.8.1) and there there i have no crash. I wonder if i can go deeper in finding the cause and making a bug report against ubuntu.
Ubuntu incorporates packages from the Debian pipeline, so the error might even be upstream. Jochen is the go-to guy in these situations, since he's a maintainer for the package in Debian. He should be able to provide more info.

Wrt the pull request: i saw '-march=native' in the GCC command line. if i understand correctly, it will tweak the flags based on which system the compile is done on.
Exactly. If the PCL_ENABLE_SSE is set to ON during the build stage (and it comes like that by default), we test which SSE/AVX flags your system supports and pass them to the compiler. Eigen is fully optimized for them and we make use of that.

And if i understand the pull request correctly, changing the architecture flags can cause ABI issues ?
Exactly.

Isn't it a bug that having different arch flags causes ABI incompatibilities ?
So from our (PCL) side, we need to make sure that we pass the compiler flags used during compilation, to projects downstream. That's what that PR is addressing.

Regarding the packaging done in Debian, I would assume they would compile and package things with PCL_ENABLE_SSE set to OFF, but I'm not familiar with the process.

Cheers



_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Segfaults in eigen's handmade_aligned_free on ubuntu artful

Sérgio Agostinho
In reply to this post by Frank Dekervel

Additionally could you file a bug. I think the intended behavior from our side is when you set the flags yourself, we should leave them untouched.

We should not tamper  with the user's choice under the hood.

Cheers

On 30-11-2017 10:22, Frank Dekervel wrote:
Hello,

i compiled my program by hand and i removed the following flags from gcc:

  -march=native

and the program did not crash anymore.

removing the following options did not have any effect:
 -msse4.1 -mfpmath=sse

is there a way to tell CMake not to put '-march=native' ? i tried CMAKE_CXX_FLAGS in all different places in the CMakeLists.txt but CMake always adds its -march=native after my options...

greetings,
Frank



On Thu, Nov 30, 2017 at 12:01 AM, Sérgio Agostinho <[hidden email]> wrote:

I just finished compiling PCL from source (release build, checkout tag 1.8.1) and there there i have no crash. I wonder if i can go deeper in finding the cause and making a bug report against ubuntu.
Ubuntu incorporates packages from the Debian pipeline, so the error might even be upstream. Jochen is the go-to guy in these situations, since he's a maintainer for the package in Debian. He should be able to provide more info.

Wrt the pull request: i saw '-march=native' in the GCC command line. if i understand correctly, it will tweak the flags based on which system the compile is done on.
Exactly. If the PCL_ENABLE_SSE is set to ON during the build stage (and it comes like that by default), we test which SSE/AVX flags your system supports and pass them to the compiler. Eigen is fully optimized for them and we make use of that.

And if i understand the pull request correctly, changing the architecture flags can cause ABI issues ?
Exactly.

Isn't it a bug that having different arch flags causes ABI incompatibilities ?
So from our (PCL) side, we need to make sure that we pass the compiler flags used during compilation, to projects downstream. That's what that PR is addressing.

Regarding the packaging done in Debian, I would assume they would compile and package things with PCL_ENABLE_SSE set to OFF, but I'm not familiar with the process.

Cheers



_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Segfaults in eigen's handmade_aligned_free on ubuntu artful

Frank Dekervel
Hello,

So i tried what you suggested and i also tried to add 
set(PCL_ENABLE_SSE OFF)

to the CMakeLists of my program (not of the pcl library as i'm using the debian packages)

However, it still says

/usr/bin/c++  -DDISABLE_DAVIDSDK -DDISABLE_DSSDK -DDISABLE_ENSENSO -DDISABLE_LIBUSB_1_0 -DDISABLE_PCAP -DDISABLE_PNG -DDISABLE_RSSDK -DFLANN_STATIC -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DvtkFiltersFlowPaths_AUTOINIT="1(vtkFiltersParallelFlowPaths)" -DvtkIOExodus_AUTOINIT="1(vtkIOParallelExodus)" -DvtkIOGeometry_AUTOINIT="1(vtkIOMPIParallel)" -DvtkIOImage_AUTOINIT="1(vtkIOMPIImage)" -DvtkIOParallel_AUTOINIT="1(vtkIOMPIParallel)" -DvtkIOSQL_AUTOINIT="2(vtkIOMySQL,vtkIOPostgreSQL)" -DvtkRenderingContext2D_AUTOINIT="1(vtkRenderingContextOpenGL)" -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL)" -DvtkRenderingFreeType_AUTOINIT="2(vtkRenderingFreeTypeFontConfig,vtkRenderingMatplotlib)" -DvtkRenderingLIC_AUTOINIT="1(vtkRenderingParallelLIC)" -DvtkRenderingVolume_AUTOINIT="1(vtkRenderingVolumeOpenGL)" -I/usr/include/vtk-6.3 -I/usr/include/freetype2 -I/usr/include/x86_64-linux-gnu/freetype2 -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu -I/usr/include/hdf5/openmpi -I/usr/include/libxml2 -I/usr/include/jsoncpp -I/usr/include/tcl -I/usr/include/pcl-1.8 -I/usr/include/eigen3 -I/usr/include/ni -I/usr/include/openni2 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64  -mno-sse -mno-sse    -march=native -msse4.1 -mfpmath=sse  -fPIC -std=gnu++11 -o CMakeFiles/crasher.dir/src/crasher.cpp.o -c /home/kervel/projects/pcl_artful_crash/crashdemo/src/crasher.cpp

Am i missing something ? is PCL_ENABLE_SSE also working in the cmakelists of programs using pcl, not only in the cmakefiles of the pcl library ?

Thanks!

Greetings,
Frank



On Thu, Nov 30, 2017 at 11:34 AM, Sérgio Agostinho <[hidden email]> wrote:

Additionally could you file a bug. I think the intended behavior from our side is when you set the flags yourself, we should leave them untouched.

We should not tamper  with the user's choice under the hood.

Cheers

On 30-11-2017 10:22, Frank Dekervel wrote:
Hello,

i compiled my program by hand and i removed the following flags from gcc:

  -march=native

and the program did not crash anymore.

removing the following options did not have any effect:
 -msse4.1 -mfpmath=sse

is there a way to tell CMake not to put '-march=native' ? i tried CMAKE_CXX_FLAGS in all different places in the CMakeLists.txt but CMake always adds its -march=native after my options...

greetings,
Frank



On Thu, Nov 30, 2017 at 12:01 AM, Sérgio Agostinho <[hidden email]> wrote:

I just finished compiling PCL from source (release build, checkout tag 1.8.1) and there there i have no crash. I wonder if i can go deeper in finding the cause and making a bug report against ubuntu.
Ubuntu incorporates packages from the Debian pipeline, so the error might even be upstream. Jochen is the go-to guy in these situations, since he's a maintainer for the package in Debian. He should be able to provide more info.

Wrt the pull request: i saw '-march=native' in the GCC command line. if i understand correctly, it will tweak the flags based on which system the compile is done on.
Exactly. If the PCL_ENABLE_SSE is set to ON during the build stage (and it comes like that by default), we test which SSE/AVX flags your system supports and pass them to the compiler. Eigen is fully optimized for them and we make use of that.

And if i understand the pull request correctly, changing the architecture flags can cause ABI issues ?
Exactly.

Isn't it a bug that having different arch flags causes ABI incompatibilities ?
So from our (PCL) side, we need to make sure that we pass the compiler flags used during compilation, to projects downstream. That's what that PR is addressing.

Regarding the packaging done in Debian, I would assume they would compile and package things with PCL_ENABLE_SSE set to OFF, but I'm not familiar with the process.

Cheers



_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users



_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Segfaults in eigen's handmade_aligned_free on ubuntu artful

Sérgio Agostinho
PCL_ENABLE_SSE needs to be disabled on PCLs compilation. If not it will propagate to your project as your seeing already. 

To override it you’ll need to whipe PCL_DEFINITIONS but that’s not a really good idea because of the vtk dependent code we have. It will not compile properly without those. 



_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

smime.p7s (3K) Download Attachment