Skip to content
This repository has been 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

Closed
bourtemb opened this issue Sep 10, 2018 · 0 comments

Comments

@bourtemb
Copy link
Member

bourtemb commented Sep 10, 2018

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.

bourtemb added a commit to bourtemb/cppTango that referenced this issue Sep 10, 2018
(Tango 9.3.1rc potential crash when an event is pushed at the same time as an
event (re)subscription occurs)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant