Opened 11 years ago

Closed 11 years ago

#607 closed defect (fixed)

Assertion and possibly crash in ICE stream transport when client is not behind NAT (thanks Nicolas Fauvel for the report)

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

Description

Symptom:

When pjsua is run with ICE, STUN, and TURN, and pjsua is not behind NAT, the following assertion will be triggered when making a call:

On v0.9:

  ./src/pjnath/ice_strans.c:826: pj_ice_strans_get_def_cand: Assertion 
`comp->default_cand>=0 && comp->default_cand<comp->cand_cnt' failed.

On v1.0-rc1 (only the line number is different):

  ./src/pjnath/ice_strans.c:853: pj_ice_strans_get_def_cand: Assertion 
`comp->default_cand>=0 && comp->default_cand<comp->cand_cnt' failed.

How to reproduce:

This can be reproduced by using the following pjsua command-line arguments:

--use-ice --use-turn --stun-srv=192.168.0.2 --turn-srv=192.168.0.2:34780 \
--turn-user=100 --turn-passwd=100

Note that the STUN server is on the same LAN as the client.

Description:

When ICE stream transport (ice_strans)is initialized, it selects a default candidate to be used as the primary address in the SDP. The default candidate is TURN candidate if TURN is used.

During the address resolution process, the STUN candidate will be removed from the candidate list if the mapped address matches one of the host addresses (i.e. when the client is not behind NAT). This process is called pruning in pjnath.

Unfortunately, the default candidate index is not updated when a candidate is removed, hence the assertion.

Change History (1)

comment:1 Changed 11 years ago by bennylp

  • Resolution set to fixed
  • Status changed from new to closed
  • Summary changed from Assertion and possibly crash in ICE stream transport client is not behind NAT (thanks Nicolas Fauvel for the report) to Assertion and possibly crash in ICE stream transport when client is not behind NAT (thanks Nicolas Fauvel for the report)

Fixed in r2258

Note: See TracTickets for help on using tickets.