geometry2
geometry2 copied to clipboard
Code has race condition risk
https://github.com/ros2/geometry2/blob/bdc0164768a95276c3c4643668910429768aa68e/tf2_ros/include/tf2_ros/message_filter.hpp#L505C7-L506C23
MessageFilter::transformReadyCallback may be called in another thread before the if condition (imagine current thread be schedule away before if). future will be added to ts_futures(current thread don't know it has been fulfilled by its handle) and it will never have chance to be erased.
Thank you for the report! Would you be willing to make a reproducible example? I'm thinking a while loop that keeps trying that code path until it triggers the race condition. That would help solve it.