[asterisk-bugs] [JIRA] (ASTERISK-26664) pjsip: pj_thread_register() assertion

Ryan Sundberg (JIRA) noreply at issues.asterisk.org
Mon Jun 24 15:41:47 CDT 2019


     [ https://issues.asterisk.org/jira/browse/ASTERISK-26664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryan Sundberg updated ASTERISK-26664:
-------------------------------------

    Comment: was deleted

(was: I had this issue with a pjproject build from source. The problem arises when PJ_DEBUG is configured in pjproject: pj_mutex_lock() will take a path that calls pj_thread_this() which fails the assertion. See here: https://github.com/pjsip/pjproject/blob/1a7c9f8882ad722c2eea6da763309de6298ff2b9/pjlib/src/pj/os_core_unix.c#L1286

It is resolved by copying the config_site.h from the asterisk bundle into the pjproject build which sets the proper definitions, including PJ_DEBUG=0 (However you may need to add #define _ASTERISK_ASTMM_H at the top of your config_site.h to skip loading some of the asterisk malloc hacks).)

> pjsip: pj_thread_register() assertion
> -------------------------------------
>
>                 Key: ASTERISK-26664
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26664
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_pjsip
>    Affects Versions: 13.13.0, 13.13.1
>         Environment: Linux, Debian unstable
>            Reporter: Bernhard Schmidt
>         Attachments: paste_903006.txt
>
>
> When a system pjproject library is used with assertions enabled (NDEBUG=0) answering an incoming call leads to the following assertion:
> {noformat}
> asterisk: ../src/pj/os_core_unix.c:692: pj_thread_this: Assertion `!"Calling pjlib from unknown/external thread. You must " "register external threads with pj_thread_register() " "before calling any pjlib functions."' failed.
> Aborted
> {noformat}
> This is caused by this commit: https://github.com/asterisk/asterisk/commit/2b9ad3a5f736b6a4081e172f2a6d35dcd20b51e4
> A production build / embedded pjproject build does not fail since assertions are disabled there. But this still points to a programming error in chan_pjsip (as the assertion says, calling pjlib functions from an unregistered thread).



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



More information about the asterisk-bugs mailing list