We have a submodule bound_mutex whose purpose is to ensure that no deadlocks are possible. We do this by having a short submodule which only accesses the BoundMutex::inner member in the get and set methods. These methods lock the mutex and immediately unlock it. The member is never accessed by any other method. This is easy to check by searching the code for inner.
HOWEVER, there is actually a hidden access to inner in the #[derive(Debug)] line on BoundMutex, and this access is incorrect. Rather than locking the mutex, cloning the Arc within, unlocking, then processing the cloned Arc, it just locks the mutex and then recursively calls stuff while it's locked. Stupid.
Fix this by manually implementing fmt::Debug, calling get rather than directly accessing inner.
We have a submodule
bound_mutex
whose purpose is to ensure that no deadlocks are possible. We do this by having a short submodule which only accesses the BoundMutex::inner member in theget
andset
methods. These methods lock the mutex and immediately unlock it. The member is never accessed by any other method. This is easy to check by searching the code forinner
.HOWEVER, there is actually a hidden access to
inner
in the#[derive(Debug)]
line onBoundMutex
, and this access is incorrect. Rather than locking the mutex, cloning the Arc within, unlocking, then processing the cloned Arc, it just locks the mutex and then recursively calls stuff while it's locked. Stupid.Fix this by manually implementing
fmt::Debug
, callingget
rather than directly accessinginner
.Fixes #224.