[asterisk-dev] [Code Review] 3954: pjsip_options.c: Fix race condition stopping periodic out of dialog OPTIONS request.

rmudgett reviewboard at asterisk.org
Wed Sep 24 13:28:26 CDT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3954/
-----------------------------------------------------------

(Updated Sept. 24, 2014, 1:28 p.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers.


Changes
-------

Committed in revision 423866


Bugs: ASTERISK-24295
    https://issues.asterisk.org/jira/browse/ASTERISK-24295


Repository: Asterisk


Description
-------

The crash on the issues is a result of an invalid transport configuration change when asterisk is restarted.  The attempt to send the qualify request fails and we cleaned up.  However, the callback is also called which results in a double unref of the objects involved.

* Put a wrapper around pjsip_endpt_send_request() to detect when the passed in callback is called because of an error so callers can know to cleanup.

* Made send_request_cb() able to handle repeated challenges (Up to 10).

* Fix periodic endpoint qualify OPTIONS sched deletion race by avoiding it.  The sched entry will no longer self stop and must be externally stopped.

* Added REF_DEBUG description tags to struct sched_data in pjsip_options.c.

* Fix some off-nominal ref leaks in schedule_qualify(), qualify_and_schedule().

* Reordered pjsip_options.c module start/stop code to cleanup better on error.


Diffs
-----

  /branches/13/res/res_pjsip/pjsip_options.c 423616 
  /branches/13/res/res_pjsip.c 423616 

Diff: https://reviewboard.asterisk.org/r/3954/diff/


Testing
-------

* With the qualify_frequency option enabled, added and removed a "local_net=" line in the transport section and restarted asterisk via "core restart now".  Before the latest patch version, asterisk would crash.  With the new patch, it keeps on going.

* Set the qualify_frequency option to different values and reloaded res_pjsip each time.  The OPTIONS poll frequency changed, started, and stopped according to the new qualify_frequency value.


Thanks,

rmudgett

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140924/bac732f3/attachment.html>


More information about the asterisk-dev mailing list