Hi, I am running monkey test on my test device having gingerbread release. The test runs for sometime and then the screen freezes with logcat messages of CPU pegging:
W/SharedBufferStack( 1551): waitForCondition(LockCondition) timed out On debugging and going through the earlier messages related to similar problem I found that in my case also SurfaceFlinger's threadLoop() is getting deadlocked at SharedBufferBase::updateCondition() which is called from SharedBufferServer::retireAndLock(). This results in the freeze of the device. On debugging further and putting some more logs in the surface flinger, I found that retireAndLock() is getting stuck for the mutex which is already being locked and unlocked by another process which is throwing "waitForCondition(LockCondition) timed out". So, the deadlock is SurfaceFlinger blocked on a shared mutex and can't update the condition and another process is waiting for the condition to be updated. I am surprised how SurfaceFlinger is blocked on the mutex which is getting acquired and released by another process. So there are enough chances for SurfaceFlinger to acquire that mutex. Is there any issue in pthread_mutex_lock() or pthread_mutex_unlock() related to shared mutexes ?? On seeing the pthread implementation, I came across warning about the shared mutex implementation in bionic is not complete and there can be some issues when thread holding mutex dies. How can I resolve this situation ?? -- unsubscribe: [email protected] website: http://groups.google.com/group/android-porting
