Re: [Boost-bugs] [Boost C++ Libraries] #11728: interprocess::message_queue deadlocked when process exists unexpectedly on Windows

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11728: interprocess::message_queue deadlocked when process exists unexpectedly on Windows
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-10-27 10:18:43


#11728: interprocess::message_queue deadlocked when process exists unexpectedly on
Windows
----------------------------------------+--------------------------
  Reporter: Lingxi Li <lilingxi.cs@…> | Owner: igaztanaga
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: interprocess
   Version: Boost 1.59.0 | Severity: Showstopper
Resolution: | Keywords: deadlock
----------------------------------------+--------------------------

Comment (by igaztanaga):

 Thanks for the ticket and the test case. This is known issue since there
 is no guarantee for deadlock detection even in non-Windows systems, robust
 mutexes are not mandatory, there is no easy fix for this. In case this
 helps you, you can define the following before using including
 interprocess:

 BOOST_INTERPROCESS_ENABLE_TIMEOUT_WHEN_LOCKING

 and optionally define a timeout (by default 10 seconds)

 BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS

 This converts any infinite mutex lock into a timed lock and throws an
 exception if the timeout passes. This won't if the message queue is
 waiting in the condition variable (one can in theory wait for a message
 for a long time). This could detect dead processes when trying to send a
 message. You can use timed receives as a workaround in reception.

 It's the best we can do now. It's similar to a inter-thead communication,
 if a thread dies or deadlocks, then you are lost.

 In any case BOOST_INTERPROCESS_ENABLE_TIMEOUT_WHEN_LOCKING, which was
 experimental, should be documented. Let me know if this at least
 alleviates the problem.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11728#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC