In check_sanity() function,
In the scenario where multiple processes share the same shared memory, if the shared memory is corrupted for some reason then when one of the processes calls check_sanity() the scoped mutex in the function locks but the process crashes with assertion without unlocking the mutex, causing any other process that will call check_sanity() to be stuck on the locked scoped mutex.
If there is a mutex in a shared memory object it must be unlocked before assertion, exception, or return.
I would expect the check_sanity() function to return false in the case of corrupted memory instead of assert.
In check_sanity() function, In the scenario where multiple processes share the same
shared memory
, if theshared memory
is corrupted for some reason then when one of the processes callscheck_sanity()
the scoped mutex in the function locks but the process crashes with assertion without unlocking the mutex, causing any other process that will callcheck_sanity()
to be stuck on the lockedscoped mutex
.If there is a
mutex
in ashared memory
object it must be unlocked beforeassertion
,exception
, orreturn
. I would expect thecheck_sanity()
function to returnfalse
in the case of corrupted memory instead ofassert
.