Memory PCL 1.8.1统计层删除后云删除崩溃

Memory PCL 1.8.1统计层删除后云删除崩溃,memory,eigen,point-cloud-library,Memory,Eigen,Point Cloud Library,我有一个应用程序,它是使用几个DLL文件构建的。 我尝试使用以下代码执行PCL的统计异常值删除: PointCloudWithRGBNormalsPtr pclCloud(new PointCloudWithRGBNormals()); ConvertPointCloudToPCL(in_out_cloud /*my own structure which includes xyz, rgb, nx ny nz*/, *pclCloud); pcl::Statisti

我有一个应用程序,它是使用几个DLL文件构建的。 我尝试使用以下代码执行PCL的统计异常值删除:

    PointCloudWithRGBNormalsPtr pclCloud(new PointCloudWithRGBNormals());

    ConvertPointCloudToPCL(in_out_cloud /*my own structure which includes xyz, rgb, nx ny nz*/, *pclCloud);

    pcl::StatisticalOutlierRemoval<PointXYZRGBNormal> sor;
    sor.setInputCloud(pclCloud);
    sor.setMeanK(10);
    sor.setStddevMulThresh(1.0);
    sor.filter(*pclCloud);
出于某种原因,如果我从我的1个DLL调用此函数,它会正常工作。但是,有一个dll,如果我从中调用它,当
pclCloud
超出范围时,我会从
Eigen
Memory.h
文件的
手工对齐\u free
函数中得到一个异常

我使用的是Windows1064位、PCL1.8.1和Eigen 3.3(试过3.3.4,同样的东西)

更新

进一步挖掘后,我发现已对齐的
EIGEN\u MALLOC\u
设置为0,因为我在“有问题”的DLL中使用了
AVX2
。我仍然不确定为什么使用Egen的“手工”对齐malloc/free会导致这次崩溃


Eigen、PCL和AVX似乎存在一个已知的问题(请参阅)。我发现了这个问题以及如何解决它

windows“All-in-1安装程序”附带的DLL似乎没有使用
AVX/AVX2
支持进行编译

当将这些库与我自己的DLL(使用
AVX
编译的DLL)链接时,这种不匹配导致
Eigen
使用不同类型的分配和释放内存导致崩溃

我使用
AVX2
从源代码编译了PCL,并链接了这些库,一切都正常

值得一提的是,以前工作的DLL现在有问题,因为它现在没有AVX和PCL

static void ConvertPointCloudToPCL(const std::vector<Cloud3DrgbN> &in, PointCloudWithRGBNormals &output)
{
    for (auto it = in.begin(); it != in.end(); it++)
    {
        const Cloud3DrgbN &p3d = *it;;
        PointXYZRGBNormal p;
        p.x = p3d.x;
        p.y = p3d.y;
        p.z = p3d.z;
        p.normal_x = p3d.nX;
        p.normal_y = p3d.nY;
        p.normal_z = p3d.nZ;
        p.r = p3d.r;
        p.g = p3d.g;
        p.b = p3d.b;
        output.push_back(p);
    }
}