Repository navigation
Fix crash of TrajectoryExecutionManager on an empty moveit_controller_manager - #3936
MatthijsBurgh wants to merge 1 commit into
Conversation
…_manager An empty '~moveit_controller_manager' skipped loading the plugin and creating `controller_mgr_node_`, but `initialize()` then read the `trajectory_execution.*` parameters from that null node and segfaulted. Return early instead, as when the parameter is missing and the plugin cannot be guessed, so an empty value loads no controller manager and disables trajectory execution. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
@henningkayser @tylerjw @v4hn Could you please review this PR? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3936 +/- ##
==========================================
+ Coverage 48.92% 48.97% +0.05%
==========================================
Files 735 736 +1
Lines 62684 62709 +25
Branches 7617 7615 -2
==========================================
+ Hits 30663 30704 +41
+ Misses 32021 32005 -16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Setting
moveit_controller_managerto an empty string crashesTrajectoryExecutionManager::initialize()with a segfault.initialize()already expects an empty value:if (!controller.empty())skips loading the plugin and creatingcontroller_mgr_node_. But further down it reads thetrajectory_execution.*parameters fromcontroller_mgr_node_and registers its parameter callback there, and that node is still null at that point.An empty value is useful when a
MoveItCpp/MoveItPyinstance only plans.MoveItCppalways creates aTrajectoryExecutionManager, and every instance with the normal MoveIt config loads the controller manager plugin and creates action clients for every controller. We hit this with a secondMoveItPyinstance used only for reachability checks. Its parameters come from the same params files, so a per-instance override (moveit_controller_manager: "") is the natural way to switch execution off there.This PR returns early on an empty value with an INFO log, like the existing branch for a missing parameter whose plugin cannot be guessed ("No paths can be executed"). In that case no plugin, controller manager node or executor thread is created. Most of the diff is the
tryblock losing one indentation level now that itsif (!controller.empty())wrapper is gone.A regression test (
test_no_controller_manager) builds the manager withmoveit_controller_manager: ""on aRobotModelBuildermodel. It segfaults without this change and passes with it, tested onjazzy, where this part of the file is identical.Backports: please add the
backport-jazzyandbackport-kiltedlabels; I can't set labels on this repository. The commit cherry-picks cleanly onto both branches. The test linksmoveit_core::moveit_test_utilsinstead of themoveit_core::moveit_coreumbrella target, because Jazzy and Kilted don't export that target.Related but independent: #3828 fixes a destructor crash in the same file and doesn't touch
initialize().Checklist
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests