rubinius/rubinius — Issue #1372: Deadlock possible when using the contention lock in objectmemory
Author: dbussink
Created: 2011-10-26 19:11:37+00:00
State: open

When a GC is requested and a stop the world is attempted, it is possible that a deadlock occurs when the contention_lock_ in objectmemory.cpp is used. This is a backtrace for all the running threads when this happened:

https://gist.github.com/47c8f2a67447576fe0bd

The problematic lines are for example 6311, 7191, 7199, 7247 and more. The problem is that it doesn't use a GCLockGuard here. Changing it is not very simple though, because it results in all paths that use ObjectHeader#lock(STATE) and ObjectHeader#unlock(STATE), which is very invasive.