Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1962 closed defect (fixed)

Premature STUN socket destruction when there's an error during STUN server resolution

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

Description

Sample stack trace:

(1) resolve_stun_entry() -> 
pj_stun_sock_start() ->  
get_mapped_addr() -> 
sess_fail() -> 
test_stun_on_status() -> 
(2) resolve_stun_entry()

The problem is caused if get_mapped_addr() fail, then test_stun_on_status() will destroy the (failed) STUN socket, and calls resolve_stun_entry no (2), which will then try another STUN candidate. However, after returning, the resolve_stun_entry no (1) will destroy the STUN socket again, incorrectly, for the new candidate being tried.

Thanks to Dusan Klinec for the report and the patch.

Change History (2)

comment:1 Changed 8 years ago by ming

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

In 5442:

Fixed #1962: Premature STUN socket destruction when there's an error during STUN server resolution

comment:2 Changed 8 years ago by ming

In 5449:

Re #1962: Update the ticket number in the code doc.

Note: See TracTickets for help on using tickets.