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

[common/transform] Fail of transformPointCloud for empty pointcloud #5871

Closed
julia-sanchez-kitware opened this issue Nov 9, 2023 · 2 comments
Labels

Comments

@julia-sanchez-kitware
Copy link

Describe the bug

When using transformPointCloud OUT-of-place with an empty input cloud, and copy_all_fields to true (default behavior), it causes a segfault.
This seems caused by the assign function here.

Context

I am trying to transform a pointcloud and put the output into a new pointcloud.

Expected behavior

When transforming a pointcloud of 0 point, the output should be a pointcloud with 0 point. The behavior inplace/out-of-place should be similar.

Current Behavior

Segfault

To Reproduce

pcl::PointCloudpcl::PointXYZ pcIn, pcOut;
pcl::transformPointCloud(pcIn, pcOut, Eigen::Isometry3d::Identity().matrix());

My environment

  • OS: [Ubuntu 22.04]
  • Compiler: [GCC 11.4]
  • PCL Version [1.12]

Possible Solution

Check if pointcloud is empty here.

@julia-sanchez-kitware julia-sanchez-kitware added kind: bug Type of issue status: triage Labels incomplete labels Nov 9, 2023
@mvieth
Copy link
Member

mvieth commented Nov 12, 2023

@julia-sanchez-kitware Hi, thank you for reporting this. The two lines you posted for reproducing did not cause any problem or segfault for me (I tested with GCC 13 and the current master branch). I believe that this problem was fixed by c1835f4 Could you test again with PCL 1.13, please?

@mvieth mvieth added module: common and removed status: triage Labels incomplete labels Nov 12, 2023
@mvieth
Copy link
Member

mvieth commented Nov 28, 2023

@julia-sanchez-kitware I just tested by undoing the changes from c1835f4 : then I get Floating point exception (core dumped). I assume that is the error you also saw? So I am confident that this error does not occur any more in PCL 1.13.0 and newer. If you still have any doubts, feel free to comment/reopen this issue/open a new issue.

@mvieth mvieth closed this as completed Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants