Skip to content

Code has race condition risk #827

@XinyuKhan

Description

@XinyuKhan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions