Mutex/Semaphores in shared memory

What will happen if we have a Mutex or a Semaphore in shared memory and one process locks it and then crashes? Will the system automatically release it?

From the description in the docu i do not think it would automatically be released, but to be sure, just write two easy app and make one of it crash while lock ^^

Wild Pointers to the own Addressspace help a lot with crashing

As long as the shared memory is still holding by other process, you dead-locked.

But for mutex, you have SyncMutexEvent(), SyncMutexRevive() to help you prevent this happening.