[asterisk-bugs] [JIRA] (ASTERISK-24514) res_pjsip_outbound_registration: stack overflow when using non-default sorcery wizard

Kevin Harwell (JIRA) noreply at issues.asterisk.org
Mon Nov 10 17:16:29 CST 2014


Kevin Harwell created ASTERISK-24514:
----------------------------------------

             Summary: res_pjsip_outbound_registration: stack overflow when using non-default sorcery wizard
                 Key: ASTERISK-24514
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24514
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Resources/res_pjsip_outbound_registration
            Reporter: Kevin Harwell


When using a non-default sorcery wizard (in this instance realtime) for outbound registrations and after adding in an appropriate call to  {{ast_sorcery_apply_config()}} (since it is missing) Asterisk will crash after a stack overflow occurs due to the code infinitely recursing.

The backtrace generated is quite large, so below is the relevant repeating lines:

{noformat}
#17 0x07174de9 in sip_outbound_registration_apply (sorcery=0x86f19fc, obj=0xc9c6454) at res_pjsip_outbound_registration.c:804
#18 0x081fc6b8 in ast_sorcery_objectset_apply (sorcery=0x86f19fc, object=0xc9c6454, objectset=0xc9c6ce8) at sorcery.c:1273
#19 0x00b7834b in sorcery_realtime_retrieve_fields (sorcery=0x86f19fc, data=0x8828628, type=0x881c914 "registration", fields=0xc9c63e0) at res_sorcery_realtime.c:161
#20 0x00b783b9 in sorcery_realtime_retrieve_id (sorcery=0x86f19fc, data=0x8828628, type=0x881c914 "registration", id=0xc9c4b40 "117") at res_sorcery_realtime.c:172
#21 0x081fbf74 in ast_sorcery_retrieve_by_id (sorcery=0x86f19fc, type=0x7177672 "registration", id=<value optimized out>) at sorcery.c:1476
#22 0x07174de9 in sip_outbound_registration_apply (sorcery=0x86f19fc, obj=0xc9c4f0c) at res_pjsip_outbound_registration.c:804
{noformat}

The issue stems from the fact that res_sorcery_realtime, unlike res_sorcery_config, calls {{ast_sorcery_objectset_apply()}} when retrieving a field by ID or when retrieving multiple fields.{{sip_outbound_registration_apply()}} calls {{ast_sorcery_object_get_by_id()}} to try to determine if there is already an existing configured object it can reuse. This kicks off the infinite recursion.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list