Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Tango 9.3.1rc: Potential crash when an event is pushed at the same time as an event (re)subcription occurs #484

@bourtemb

Description

@bourtemb

A problem introduced in PR #423 could lead to a crash of a device server when it tries to push an event at the same time as it is receiving a ZmqEventSubscriptionChange command.
This problem is coming from the fact that ZmqEventSupplier::create_full_event_name() is now called at the end of DServer::zmq_event_subscription_change() method. This method is modifying ZmqEventSupplier::event_name and ZmqEventSupplier::ctr_event_name members but its access is not protected by any mutex when this method is called in DServer::zmq_event_subscription_change() so several threads can modify its value which can get corrupted and lead to crashes.
One possible simple fix would be to have ZmqEventSupplier::create_full_event_name() no longer using ZmqEventSupplier::event_name and ZmqEventSupplier::ctr_event_name but using a local variable instead.
Some changes would then be required in ZmqEventSuppler::push_event() to store the result from create_full_event_name() in event_name and ctr_event_name variables.

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