Skip to content
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

[Surface]Using MovingLeastSquares results in a segfault within performUpsampling function #5471

Closed
jsnapz opened this issue Oct 14, 2022 · 2 comments · Fixed by #5483
Closed
Labels
good first issue Skills/areas of expertise needed to tackle the issue kind: bug Type of issue module: surface

Comments

@jsnapz
Copy link

jsnapz commented Oct 14, 2022

Environment Current - Not Working
OS: Ubuntu 20.04.4 LTS
Compiler: GCC 9.4.0
PCL Version: 1.10.0
Architecture: aarch64

Environment Past - Worked
OS: Ubuntu 18.04.6 LTS
Compiler: GCC 7.5.0
PCL Version: 1.8.1
Architecture: aarch64

Hello,

I'm having an issue where I have ported my project over to a new environment. My project used to work before with my past environment but now it is not working with the current. Everything compiles fine but when I run I am getting a segmentation fault when I run. I narrowed it down to happening inside the process function and then inside that the performSampling function. It looks like there were changes in GitHub between these versions(1.8.1 vs 1.10.0) and I thought I accounted for everything but maybe not. I also checked with the master branch and 1.10.0 looks the same for that function.

Sor cloud was obtained through a .ply

Picture of source code past environment

old

Picture of source code current environment

New

Pictures of seg fault from current environment
seg
seg2

Thank you for the help

@jsnapz jsnapz added kind: bug Type of issue status: triage Labels incomplete labels Oct 14, 2022
@mvieth
Copy link
Member

mvieth commented Oct 15, 2022

Thanks for the detailed issue report! It seems like this segfault happens when dereferencing normals_, which wasn't set because setComputeNormals was set to false. Try setting it to true instead.
This behaviour changed with this pull request: #1960 (since PCL 1.9.0). Let me check whether this is a bug and how to fix this in the PCL code

@mvieth mvieth added module: surface and removed status: triage Labels incomplete labels Oct 15, 2022
@mvieth
Copy link
Member

mvieth commented Oct 15, 2022

I would say the fix is to simply move the normals_.reset out of the if-statement here: https://github.com/PointCloudLibrary/pcl/blob/master/surface/include/pcl/surface/impl/mls.hpp#L69
If you like, you could create a pull request to fix this. Otherwise I or someone else will do that sometime

@mvieth mvieth added the good first issue Skills/areas of expertise needed to tackle the issue label Oct 15, 2022
mvieth added a commit to mvieth/pcl that referenced this issue Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Skills/areas of expertise needed to tackle the issue kind: bug Type of issue module: surface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants