Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#689 closed defect (fixed)

Deadlock caused by ICE media transport (thanks Alain Totouom for the report)

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

Description (last modified by bennylp)

The mutex locking in ICE transport may cause deadlock in application. Consider this scenario:

Thread 1:

  • RTP packet arrives
  • the pj_ice_sess_on_rx_pkt() is called
  • ICE session's mutex is acquired
  • ice->cb.on_rx_data() callback is called
  • application acquires some application mutex B (e.g. conference bridge's mutex).

Thread 2:

  • application acquires some application mutex B (e.g. conference bridge's mutex)
  • RTP packet needs to be transmitted
  • the pj_ice_sess_send_data() function is called
  • thread is acquiring ICE session's mutex, and it will deadlock.

(Stable branch: the corresponding ticket for the 1.0 branch is ticket #691)

Change History (3)

comment:1 Changed 15 years ago by bennylp

  • Resolution set to fixed
  • Status changed from new to closed
  • Summary changed from Deadlock caused by ICE media transport (thanks Alain Totouom) to Deadlock caused by ICE media transport (thanks Alain Totouom for the report)

Fixed in r2419:

  • don't hold the ICE session's mutex when calling ice->cb.on_rx_data() callback. We don't need to hold this since ICE session's lifetime is already protected by the ICE transport (ice_strans).

comment:2 Changed 15 years ago by bennylp

  • Milestone changed from release-1.0.2 to release-1.1

comment:3 Changed 15 years ago by bennylp

  • Description modified (diff)
Note: See TracTickets for help on using tickets.