[asterisk-bugs] [JIRA] (ASTERISK-24731) res_pjsip_session cannot be unloaded

Matt Jordan (JIRA) noreply at issues.asterisk.org
Thu Mar 12 20:08:34 CDT 2015


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

Matt Jordan commented on ASTERISK-24731:
----------------------------------------

You're getting crashes due to calling PJSIP functions from a non-PJSIP registered thread:

{noformat}
#0  0x00007fd5ac56bcc9 in __GI_raise (sig=sig at entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56	../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
#0  0x00007fd5ac56bcc9 in __GI_raise (sig=sig at entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
        resultvar = 0
        pid = 30776
        selftid = 30876
#1  0x00007fd5ac56f0d8 in __GI_abort () at abort.c:89
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x7fff58f2f2db, sa_sigaction = 0x7fff58f2f2db}, sa_mask = {__val = {140555697465532, 140555312626520, 692, 4294967295, 140555696104675, 4294967296, 140555736862448, 38654705664, 0, 3519, 0, 0, 0, 21474836480, 140555738025984, 140555697480656}}, sa_flags = -1787101968, sa_restorer = 0x7fd5957aff01 <__PRETTY_FUNCTION__.5427>}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00007fd5ac564b86 in __assert_fail_base (fmt=0x7fd5ac6b63d0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion at entry=0x7fd5957afcf0 "!\"Calling pjlib from unknown/external thread. You must \" \"register external threads with pj_thread_register() \" \"before calling any pjlib functions.\"", file=file at entry=0x7fd5957afb58 "../src/pj/os_core_unix.c", line=line at entry=692, function=function at entry=0x7fd5957aff01 <__PRETTY_FUNCTION__.5427> "pj_thread_this") at assert.c:92
        str = 0x7fd5a400da50 "\200", <incomplete sequence \333>
        total = 4096
#3  0x00007fd5ac564c32 in __GI___assert_fail (assertion=0x7fd5957afcf0 "!\"Calling pjlib from unknown/external thread. You must \" \"register external threads with pj_thread_register() \" \"before calling any pjlib functions.\"", file=0x7fd5957afb58 "../src/pj/os_core_unix.c", line=692, function=0x7fd5957aff01 <__PRETTY_FUNCTION__.5427> "pj_thread_this") at assert.c:101
No locals.
#4  0x00007fd59579758c in pj_thread_this () from /usr/lib/libpj.so.2
No symbol table info available.
#5  0x00007fd5957a115a in pj_log () from /usr/lib/libpj.so.2
No symbol table info available.
#6  0x00007fd5957a169b in pj_log_4 () from /usr/lib/libpj.so.2
No symbol table info available.
#7  0x00007fd595c40da5 in unload_module () from /usr/lib/libpjsip.so.2
No symbol table info available.
#8  0x00007fd595c40c3c in pjsip_endpt_unregister_module () from /usr/lib/libpjsip.so.2
No symbol table info available.
{noformat}

You'll need to marshal the call to {{pjsip_endpt_unregister_module}} from a PJSIP thread, synchronize on it completing, then continue the unload process.

> res_pjsip_session cannot be unloaded
> ------------------------------------
>
>                 Key: ASTERISK-24731
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24731
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_pjsip_session
>    Affects Versions: SVN, 13.1.0
>            Reporter: Corey Farrell
>         Attachments: backtrace_3296.txt, backtrace_7937.txt, chan_pjsip-ref-fixes.patch
>
>
> res_pjsip_session cannot be unloaded or shutdown, causing huge numbers of leaks to be reported by REF_DEBUG or valgrind. This makes it impossible to do automated checks for memory leaks against chan_pjsip.  All testsuite tests to fail if REF_DEBUG is enabled and res_pjsip_session is loaded.
> This is follow up to ASTERISK-24485.  As with that bug it's important for the module to clean itself up on graceful shutdown, less important to allow users to unload the module without shutdown.



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



More information about the asterisk-bugs mailing list