Opened 13 years ago
Closed 13 years ago
#1464 closed defect (fixed)
Deadlock between PJSUA LOCK and conference mutex (thanks Marcus Froeschl for the report)
Reported by: | nanang | Owned by: | bennylp |
---|---|---|---|
Priority: | normal | Milestone: | release-1.14 |
Component: | pjsua-lib | Version: | common |
Keywords: | Cc: | ||
Backport to 1.x milestone: | Backported: |
Description
Deadlock scenario:
Thread 1 (audio playback thread):
- play_cb() calls conference get_frame()
- conference mutex is acquired, and conf starts collecting frames from ports
- wav player (a conf port member) triggers EOF callback to application
- application calls pjsua_conf_disconnect()
- check_snd_dev_idle() in pjsua_conf_disconnect() tries to acquire PJSUA LOCK that is being held by thread 2.
Thread 2 (pjsua worker thread):
- pjsua_call_on_state_changed() invoked
- PJSUA LOCK is acquired
- pjsua triggers on_call_state() callback to application
- application calls pjsua_conf_connect()
- pjsua_conf_connect() waits for conference mutex that is being held by thread 1.
Change History (1)
comment:1 Changed 13 years ago by nanang
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
(In [3977]) Fix #1464: Only use PJSUA lock in PJSUA implementations of INVITE session callbacks when updating 'pjsua_var' is needed, while updating 'pjsua_call' should be enough with call/dialog lock (which is actually being held by the INVITE session layer during invoking its callback).