Opened 10 years ago

Closed 10 years ago

#1759 closed defect (fixed)

Crash when BYE is received while adding new media

Reported by: riza Owned by: bennylp
Priority: normal Milestone: release-2.3
Component: pjsua-lib Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description (last modified by nanang)

Crash is reported to happen when adding media with STUN and ICE enabled.


  1. When adding media, pjsua will create a new ICE media transport, and currently such transport creation for adding media is a synchronous operation, so technically there is busy waiting loop for STUN resolution etc.
  2. While the transport creation process is ongoing (in the busy waiting loop), there is incoming BYE which clears the call states, and when the busy waiting loop is done, crash occurs as media transport (call_med->tp) is NULL.

Reproducing steps:

  1. make a call using pjsua app with ICE and STUN enabled
  2. kill/block the STUN server
  3. add video for the call, it will take time as the STUN server is off (optionally, set PJ_STUN_RTO_VALUE to 1000 to make it much longer)
  4. send BYE from other endpoint

Thanks to Itay Bianco for the report.

Change History (5)

comment:1 Changed 10 years ago by riza

  • Description modified (diff)

comment:2 Changed 10 years ago by riza

  • Description modified (diff)

comment:3 Changed 10 years ago by riza

  • Description modified (diff)

comment:4 Changed 10 years ago by nanang

  • Description modified (diff)

comment:5 Changed 10 years ago by nanang

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

In 4820:

Fix #1759: Added check for call disconnection in ICE media transport creation.

Note: See TracTickets for help on using tickets.