~afrantzis/mir/fix-mircommon-debian-replaces

Viewing all changes in revision 1794.

  • Committer: Tarmac
  • Author(s): Andreas Pokorny
  • Date: 2014-07-25 15:34:13 UTC
  • mfrom: (1788.1.3 fix-1346952)
  • Revision ID: tarmac-20140725153413-lqywxzd649rfipsl
Fixes an update problem that causes an exception inside ASIO. (lp: #1346952)

The problem occurs when the response of a client races with another send operation about the mia::InputSender::ActiveTransfer object. Previously a reponse leads to deregistration of the fd. That operation is implemented by first removing the ActiveTransfer from the internal registry before it gets destroyed and unregistered. Meanwhile the sending thread forces the creation of another ActiveTransfer with the same file descriptor. This operation fails at epoll_ctl, since it attempts to add the fd another time.

This fix changes InputSender to register an FDHandler on first send attempt, and unregisters the file descriptor when the surface is removed. Additionally the unregistration on destruction is done with the sender_mutex locked. Which avoids a similar scenario when a surface gets removed while one with the same fd gets added and used. Fixes: https://bugs.launchpad.net/bugs/1346952.

Approved by PS Jenkins bot, Alexandros Frantzis, Daniel van Vugt, Alberto Aguirre, Kevin DuBois.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: