Skip to content

StatusChangeLogger is not thread safe #852

Closed
@kfabian

Description

@kfabian

Describe the bug
I encountered double free memory errors in the RosTopicLogger from Nav2 when using ThreadedAction nodes in my behavior tree.
I think the issue here is that the callback function of StatusChangeLogger gets called on each setStatus call and the ThreadedAction node calls setStatus from a different thread.
The concrete implementations of StatusChangeLogger are not aware that their implementation of callback might get called from different threads in parallel, so I think it would be best to prevent this from happening by adding a lock to the subscribeCallback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions