geometry2 icon indicating copy to clipboard operation
geometry2 copied to clipboard

Code has race condition risk

Open XinyuKhan opened this issue 5 months ago • 1 comments

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.

XinyuKhan avatar Sep 03 '25 11:09 XinyuKhan

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.

sloretz avatar Sep 11 '25 23:09 sloretz