Opened 11 years ago

Closed 11 years ago

#1691 closed defect (fixed)

Deadlock in NAT detect

Reported by: nanang Owned by: bennylp
Priority: normal Milestone: release-2.2
Component: pjnath Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no


It is caused by non-uniform lock ordering between NAT detect and STUN session.


Thread 1:

  1. NAT detect on_request_complete() is called by STUN session while holding STUN session lock (the lock is a loose/independent group lock)
  2. in the callback, NAT detect is about to acquire its own lock

Thread 2:

  1. NAT detect on_read_complete() is called by ioqueue, and soon NAT detect lock is acquired
  2. in the callback, NAT detect calls pj_stun_session_on_rx_pkt() which tries to acquire STUN session lock

Change History (1)

comment:1 Changed 11 years ago by nanang

  • Resolution set to fixed
  • Status changed from new to closed

In 4573:

Fix #1691: Apply group lock mechanism in NAT detect to avoid deadlock.

Note: See TracTickets for help on using tickets.