[Humble] Removing a node with more than one auto-added callback group leaves a dangling guard condition in the executor
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- cpp
- Área
- backend-api-design
Línea de trabajo
Start with Executor::remove_node and remove_callback_group_from_map, then inspect how callback group guard conditions are removed from the memory strategy and how wait_for_work cleans up expired groups. The report identifies the suspected branch and the Humble fix direction. Done when unloading a node with multiple automatically added callback groups no longer leaves a dangling guard condition and both executor variants keep running.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug report
- Operating system: Ubuntu 22.04
- Installation type: binaries
- Version: Humble, rclcpp 16.0.8 (code unchanged in 16.0.21)
- DDS implementation: Fast DDS (
rmw_fastrtps_cpp) - Client library: rclcpp
Steps to reproduce
A composable node that keeps one extra callback group alive as a member (added to the executor automatically) with a timer on it:
#include <chrono>
#include <rclcpp/rclcpp.hpp>
#include <rclcpp_components/register_node_macro.hpp>
namespace repro
{
// Parameter extra_group:=false puts the timer on the default group (the control case).
class TwoGroup : public rclcpp::Node
{
public:
explicit TwoGroup(const rclcpp::NodeOptions & options)
: Node("two_group", options)
{
if (declare_parameter("extra_group", true)) {
group_ = create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive);
}
timer_ = create_wall_timer(std::chrono::seconds(1), [] {}, group_);
}
private:
rclcpp::CallbackGroup::SharedPtr group_;
rclcpp::TimerBase::SharedPtr timer_;
};
} // namespace repro
RCLCPP_COMPONENTS_REGISTER_NODE(repro::TwoGroup)
CMake: add_library(two_group SHARED ...) plus rclcpp_components_register_nodes(two_group "repro::TwoGroup").
/opt/ros/humble/lib/rclcpp_components/component_container_mt --ros-args -r __node:=repro_container &
ros2 component load /repro_container two_group_repro repro::TwoGroup -p extra_group:=true
ros2 component unload /repro_container 1
Expected behaviour
The node unloads and the container keeps running.
Actual behaviour
component_container_mt: segmentation fault right after the unload (3/3 runs). Withextra_group:=false(timer on the default group) the container survives (3/3).component_container(single-threaded): aborts (SIGABRT) withextra_group:=true; survives withfalse.- In a larger node, gdb shows the fault in
__rmw_wait(rmw_fastrtps_shared_cpp) on the guard condition of one of the removed node's callback groups, already destroyed by~NodeBase.
Additional information
Executor::remove_node calls remove_callback_group_from_map for each of the node's groups. That function removes the group's guard condition from the memory strategy, and erases it from weak_groups_to_guard_conditions_, only inside the !has_node(...) && !has_node(...) branch, which is true only for the node's last group. Every earlier group's guard condition stays in the memory strategy as a raw pointer and dangles once the node is destroyed. The expired-group cleanup in wait_for_work does not catch it, because remove_callback_group_from_map has already erased the group from weak_groups_to_nodes_. Jazzy's executor rewrite removed this code; a Humble fix would move the guard-condition removal out of that branch.
- Lenguaje dominante
- C++
- Estrellas
- 829
- Forks
- 587
- Merge medio
- 4 d 6 h
- PR fusionados (30 d)
- 30
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ros2/rclcpp
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
Memory grows per callback group created and destroyed on long lived nodesPosiblemente ocupada @jwallace42 la tomó hace 1 día. Abiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 28/100
ros2/rclcpp#3428 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
removing and immediately re-adding a node to the EventsCBGExecutor leaves its entities unregisteredPosiblemente ocupada @skyegalaxy la tomó hace 10 días. Abiertobug
ros2/rclcpp#3418 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Copy constructor exception leaks intra-process message allocationPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
Todos los issues de ros2/rclcpp
Issues similares
-
bug
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
EchoTools/nevr-runtime#2912 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
[SDL3pp] update to 0.12.0Abiertocategory:port-update
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
bug-unconfirmed
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
libc++
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
llvm/llvm-project#246508 ·
Los mantenedores suelen responder en 1 día