万恶的Soft Deadlock!

今天调试开发板,突然出现画面卡死不动了,top 之后发现 所有的进程都在没有崩溃退出的现象。

调查LOG,显示如下LOG,

 

 17:14:59.547   pjsua_call.c  Timed-out trying to acquire dialog mutex (possibly system has deadlocked) in pjsua_call_hangup()

 

经过多方调查,在PJSIP官网上 发现如下的解释:

===================================================================

Soft Deadlock

Although hard deadlock (where application just freezes) should never happen when the above guidelines are used, there may be cases when application gets a soft deadlock state. When this happens, application will not freeze permanently, but rather it will freeze for few seconds while PJSUA-LIB is trying to acquire the locks, and these message may appear in the log afterwards:

Timed-out trying to acquire PJSUA mutex (possibly system has deadlocked) in pjsua_xxx

This could happen for example in the following scenario:

  1. application callback is called
  2. application posts a job to a worker thread, and blocks until it gets result from the worker thread
  3. the worker thread calls some PJSUA-LIB call API
  4. when PJSUA-LIB tries to acquire locks with acquire_call() on behalf of the worker thread, it will fail to get them because the locks are currently being held by the callback thread (in step no 1 above). In this case, rather than deadlocking permanently, PJSUA-LIB will timeout after it retries acquiring the locks for few seconds, and returns PJ_ETIMEDOUT error to acquire_call() caller.

This is a generic application design problem, and is not caused by PJSUA-LIB (in fact PJSUA-LIB has helped us here by not deadlocking permanently).

As for the solution, quoting the famous saying: I'll leave that as an exercise for the reader. ;-) -->这个问题留给各位看官解决哦!

Soft Deadlock When Working with Multiple Calls

Ticket #1371 reports another soft deadlock case when working with multiple calls.

==============================

你可能感兴趣的:(调试,Softdeadlock,软僵死,pjsip死锁)