-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault due data race on destroyed listener #717
Comments
@mauropasse I am not sure whether your proposed fix is the correct one. Three lines after setting It might be worth investigating another route: adding a pre-shutdown callback that calls |
@MiguelCompany yes, the fix is not correct, was just for illustration purpuses. We have in one hand the The problem is that, since they share the listener, there is a data race when the publisher is destroyed, and the event wants to access its listener (also destroyed) to unset the callback. So there should be a mutex or some way to sync this, so the PD: I'm not sure if I understood correctly your proposal of adding a pre-shutdown callback. |
Can we close this now that ros2/rclcpp#2349 is merged? |
@mauropasse @clalancette we might want to backport this to Iron? segmentation fault should be avoided, and this is ABI compatible change? it is maintained under |
@fujitatomoya it'd be nice to backport this fix both to Humble & Iron. Nevertheless I'm not 100% sure this doesn't cause an ABI break since I'm changing the body of the virtual destructor (base class) and also derived class. This may lead to modifications in the vtable, which can break binary compatibility. Is there any way to test this? |
this comes to my interest, i will do some experimental test... my idea is if there is |
You can generally run https://github.com/lvc/abi-compliance-checker for this. That said, I'm pretty sure this is going to break ABI, since we are changing the vtable.
Yeah, it would be awesome if we had a workflow that detects ABI compatibility. We'd have to be a bit careful of the UI with it, since ABI breaks are allowed in Rolling, but not in other branches. |
The destructor of Let's see what the ABI checker says, but I think this could be ABI compatible. |
Looks like is ABI compatible:
|
@Mergifyio backport iron humble (edit: sorry not here...) |
Iron backport: ros2/rclcpp#2387 |
On ROS2 Iron (or Galactic/Humble with EventsExecutor package), the example below produces a seg-fault due a data race trying to access a deleted listener
rmw_fastrtps/rmw_fastrtps_shared_cpp/src/rmw_event.cpp
Line 160 in ad4550a
I made a proof of concept fix for this: mauropasse@adf1aa7
Not sure if there are better ways to handle the situation. What do you think?
The backtrace:
The text was updated successfully, but these errors were encountered: