Skip to content

Fix segfault by adding __enter__ and __exit__ to Waitable - #761

Merged
sloretz merged 1 commit into
masterfrom
rclpy_760_segfault__waitable_context_manager
Apr 8, 2021
Merged

sloretz merged 1 commit into
masterfrom
rclpy_760_segfault__waitable_context_manager

Conversation

@sloretz

@sloretz sloretz commented Apr 7, 2021

Copy link
Copy Markdown
Contributor

Fixes #760

Also make QoS event waitable use it. This fixes a crash when another
thread is spinning on a destroyed subscription using cyclonedds.

I was never able to reproduce the crash with rqt_console, but I can confirm it fixes the crash with this MRE #760 (comment)

Also make QoS event waitable use it. This fixes a crash when another
thread is spinning on a destroyed subscription using cyclonedds.

Signed-off-by: Shane Loretz <[email protected]>
@sloretz

sloretz commented Apr 7, 2021

Copy link
Copy Markdown
Contributor Author

CI (build: --packages-above-and-dependencies rclpy test: --packages-above rclpy)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@clalancette

Copy link
Copy Markdown
Contributor

As an FYI, I was able to reproduce the problem with the rqt_console plugin, and this seems to solve it for me.

@clalancette

Copy link
Copy Markdown
Contributor

@sloretz Do you think this will also fix #762 ?

@sloretz

sloretz commented Apr 7, 2021

Copy link
Copy Markdown
Contributor Author

@sloretz Do you think this will also fix #762 ?

It seems likely based on the investigation done on it.

mjeronimo pushed a commit to ros-visualization/rqt_topic that referenced this pull request Apr 7, 2021
ros2/rclpy#761 fixes this issue.

Signed-off-by: Michael Jeronimo <[email protected]>

@ivanpauno ivanpauno left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, thanks @sloretz !!

@sloretz

sloretz commented Apr 8, 2021

Copy link
Copy Markdown
Contributor Author

2 approvals and green CI, merging 🎉

@sloretz
sloretz merged commit a75529d into master Apr 8, 2021
@delete-merged-branch
delete-merged-branch Bot deleted the rclpy_760_segfault__waitable_context_manager branch April 8, 2021 16:17
clalancette pushed a commit to ros-visualization/rqt_topic that referenced this pull request Apr 29, 2021
ros2/rclpy#761 fixes this issue.

Signed-off-by: Michael Jeronimo <[email protected]>
@tfoote

tfoote commented Aug 30, 2022

Copy link
Copy Markdown
Contributor

@Mergifyio backport foxy

mergify Bot pushed a commit that referenced this pull request Aug 30, 2022
Also make QoS event waitable use it. This fixes a crash when another
thread is spinning on a destroyed subscription using cyclonedds.

Signed-off-by: Shane Loretz <[email protected]>
(cherry picked from commit a75529d)
@mergify

mergify Bot commented Aug 30, 2022

Copy link
Copy Markdown
Contributor

backport foxy

✅ Backports have been created

Details

tfoote added a commit that referenced this pull request Sep 1, 2022
Fix segfault by adding __enter__ and __exit__ to Waitable (backport #761)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An rcl_event_t might be destroyed while a waitset is still using it

5 participants