[ros2run]: Segmentation fault when segmenting specific green dots
Describe the bug
Launched glim map_editor in docker image koide3/glim_ros2:humble_cuda12.2. Then following the guide Manual Object Removal, I selected the object (on the screenshot_02), segmented it and remove, selected the remaining green dots (on the screenshot_03) set the radius (as in the screenshot_03) and clicked segment, after which the interface closed and there was a [ros2run]: Segmentation fault in the terminal.
To Reproduce
- Launch map_editor:
docker run \ -it \ --rm \ --net=host \ --ipc=host \ --pid=host \ --gpus all \ -e=DISPLAY \ -e=ROS_DOMAIN_ID \ -v $(realpath config):/glim/config \ -v home/user/inarimae_mmm:/glim/data \ koide3/glim_ros2:humble_cuda12.2 \ ros2 run glim_ros map_editor config_path:=/glim/config - Clicked Open New Map and select dump_01, previously downloaded from Example dump data
- Right click a point on an object on the screenshot_02, Segmentation -> Select MinCut -> Adjust Foreground radius and Background radius, Click Segment, Remove selected points
- Right click a point on an remaining green dotss on the screenshot_03, Segmentation -> Select MinCut -> Adjust Foreground radius - 0.500 and Background radius - 0.510, Click Segment
- See [ros2run]: Segmentation fault in terminal
Expected behavior
The points were expected to be segmented
Screenshots
screenshot_01
screenshot_02
screenshot_03
screenshot_04
Environment
- CPU/GPU: Intel® Core™ i5-10400F × 12/NVIDIA GeForce RTX™ 4070
- OS: Ubuntu 24.04
- ROS: ROS2 humble
- CUDA: CUDA 12.2
- Build with CUDA: ON
Additional context Add any other context about the problem here.
It didn't reproduce in my environment, but I guess there is an issue in the handling of isolated points in gtsam_points. I'll check the implementation to fix it.
I found and fixed a bug in the mincut implementation that causes segfaults when the size of the selected point cloud is too small: https://github.com/koide3/gtsam_points/pull/79