TopicPublisherROS2: fix Re-Publisher crashes (#477, #759)#118
Open
Alvvalencia wants to merge 2 commits intoPlotJuggler:mainfrom
Open
TopicPublisherROS2: fix Re-Publisher crashes (#477, #759)#118Alvvalencia wants to merge 2 commits intoPlotJuggler:mainfrom
Alvvalencia wants to merge 2 commits intoPlotJuggler:mainfrom
Conversation
- GenericPublisher passed its `callbacks_` member by reference to
rclcpp::PublisherBase. Base init runs before member init, so rclcpp
read uninitialized std::function memory and crashed inside the
PublisherBase ctor. Pass a temporary rclcpp::PublisherEventCallbacks{}
and drop the dead member.
- setEnabled() eagerly created tf2_ros TransformBroadcaster / Static
broadcaster even for bags without /tf data. On Jazzy/Rolling this
triggers a separate tf2_ros QoS-override parameter-declaration crash
inside rclcpp. Defer broadcaster creation to broadcastTF() so it
only happens once /tf or /tf_static actually carries data.
Closes #477, #759.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #477, #759.
Two separate crashes triggered by enabling the Re-Publisher:
GenericPublisherpassed itscallbacks_member by reference torclcpp::PublisherBase. Base-class init runs before member init, sorclcpp read uninitialized
std::functionmemory and crashed insidethe
PublisherBasector. Pass a temporaryPublisherEventCallbacks{}and drop the dead member.
setEnabled()eagerly createdtf2_rosTransformBroadcaster / Staticbroadcaster even for bags with no
/tfdata. On Jazzy/Rolling thistriggers a separate tf2 QoS-override parameter-declaration crash inside
rclcpp. Defer broadcaster creation to
broadcastTF()so it only runsonce
/tfor/tf_staticactually carries data.