[asterisk-bugs] [JIRA] (ASTERISK-29698) Segfault if sorcery object_lifetime_maximum and qualify_frequency the same value

Joshua C. Colp (JIRA) noreply at issues.asterisk.org
Tue Nov 9 19:00:50 CST 2021


    [ https://issues.asterisk.org/jira/browse/ASTERISK-29698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=256833#comment-256833 ] 

Joshua C. Colp commented on ASTERISK-29698:
-------------------------------------------

It is needed if the intent of the code in question is correct. Without it there would be a memory leak of the cache, because the reference would never be released in the scenario. That is according to the original intent of the code. I don't believe simply removing it is the correct fix, it has to be understood in greater detail precisely the order of things. For example based on the log it may be that schedule_cache_expiration is getting called twice, and scheduling cache expiration to occur twice. That's not supposed to happen - which would mean that the core issue is it getting scheduled twice in the first place.

> Segfault if sorcery object_lifetime_maximum and qualify_frequency the same value
> --------------------------------------------------------------------------------
>
>                 Key: ASTERISK-29698
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29698
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_pjsip, Resources/res_sorcery_memory_cache
>    Affects Versions: 16.21.1
>            Reporter: Alexei Gradinari
>            Assignee: Unassigned
>         Attachments: bt2.txt, bt.txt, core-brief.txt, core-full.txt, core-full.txt, core-locks.txt, core-thread1.txt, core-thread1.txt, refs-0x1a642c8.txt
>
>
> sorcery.conf:
> [res_pjsip]
> endpoint=realtime,ps_endpoints
> endpoint/cache=memory_cache,maximum_objects=3000,expire_on_reload=yes,object_lifetime_maximum=30
> aor=realtime,ps_aors
> aor/cache=memory_cache,maximum_objects=3000,expire_on_reload=yes,object_lifetime_maximum=30
> The endpoint with aor's static contact and qualify_frequency = 30
> I think one thread 'sorcery_memory_cache' clears cache due to expiry
> and another thread 'pjsip_options' uses the same cache object which is already freed.



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



More information about the asterisk-bugs mailing list