[asterisk-bugs] [JIRA] (ASTERISK-25096) Segfault when registering over websockets with PJSIP (in ast_sockaddr_isnull at /include/asterisk/netsock2.h)

Matt Jordan (JIRA) noreply at issues.asterisk.org
Wed May 20 15:21:33 CDT 2015


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

Matt Jordan commented on ASTERISK-25096:
----------------------------------------

Looking at the backtrace, {{session}} is NULL:

{code}
Program terminated with signal 11, Segmentation fault.
#0  0x00000000005783bb in ast_sockaddr_isnull (addr=0x10) at /usr/local/src/asterisk-13-git/include/asterisk/netsock2.h:115
115		return !addr || addr->len == 0;
#0  0x00000000005783bb in ast_sockaddr_isnull (addr=0x10) at /usr/local/src/asterisk-13-git/include/asterisk/netsock2.h:115
No locals.
#1  0x00000000005784c4 in ast_sockaddr_stringify_fmt (sa=0x10, format=3) at netsock2.c:78
        sa_ipv4 = {ss = {ss_family = 160, __ss_align = 6334499, __ss_padding = "H\016\000\000\000\000\000\000\000\203\214\000\000\000\000\000\020)\001D\210\177\000\000@#\000@\210\177\000\000\300\253\035z\210\177\000\000\324\316`\000\000\000\000\000\300\253\035z\210\177\000\000\345\a_\323\377\177\000\000 \254\035z\210\177\000\000\324{\314F\211\177\000\000 \254\035z\210\177\000\000\324{\314F\211\177\000\000\020\000\000\000\000\000\000\000\000\\\000\304\210\177\000"}, len = 0}
        sa_tmp = 0xffffffff8000dc80
        host = '\000' <repeats 16 times>, "\001\000\000\000\000\000\000\000\300\247\035z\210\177\000\000\260\250\035z\210\177\000\000p\252\035z\210\177\000\000\320\035\315F\211\177\000\000\006\036\315F\211\177\000\000`\252\035z\210\177\000\000\005\000\000\000\000\000\000\000p\252\035z\210\177\000\000\320\035\315F\211\177\000\000`\252\035z\210\177\000\000\215\223\235F\211\177", '\000' <repeats 26 times>, "p\257\035z\210\177", '\000' <repeats 18 times>"\320, \256\035z\210\177", '\000' <repeats 42 times>, "@\252\035z\210\177\000\000H\252\035z\210\177\000\000P\252\035z\210\177\000\000X\252\035z\210\177\000\000x\257\035z\210\177\000\000\000\000\000\000\000\000\000\000\210\257\035z\210\177", '\000' <repeats 34 times>, "\031P\314F\211\177\000\000\000\000\000\000\000\000\000@", '\000' <repeats 376 times>, "p\252\035z\210\177\000\000\324{\314F\211\177\000\000\000\345"...
        port = "\000\000\000\000\000\000\000@", '\000' <repeats 23 times>
        str = 0x7f8946cc5019
        e = 0
        size = 1059
        __PRETTY_FUNCTION__ = "ast_sockaddr_stringify_fmt"
#2  0x00007f889a1a2372 in ast_sockaddr_stringify (addr=0x10) at /usr/local/src/asterisk-13-git/include/asterisk/netsock2.h:232
No locals.
#3  0x00007f889a1a33b9 in transport_read (data=0x7f887a255810) at res_pjsip_transport_websocket.c:208
        read_data = 0x7f887a255810
        newtransport = 0x7f88c4005668
        session = 0x0
        rdata = 0x7f88c40057c0
        recvd = 32649
        buf = {ptr = 0x7f8844012970 "`j\001D\210\177", slen = 0}
        __PRETTY_FUNCTION__ = "transport_read"
{code}

That's bad. That means there is no longer a WebSocket session.

For whatever reason, it looks like {{ast_websocket_read}} doesn't return -1 even if the underlying read fails. That feels wrong, but could explain how we managed to call the callback with a NULL session.

> Segfault when registering over websockets with PJSIP (in ast_sockaddr_isnull at /include/asterisk/netsock2.h)
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-25096
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-25096
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_pjsip
>    Affects Versions: SVN
>         Environment: Debian 7.8, pjproject 2.3.0, Asterisk GIT-master-908c6a5 (18/May/15)
>            Reporter: Josh Kitchens
>            Assignee: Josh Kitchens
>         Attachments: core20150518-0943.txt, core.txt, pjsip configuration.conf, WSasteriskcrash.txt, wsRegister20150518-0943.txt
>
>
> Asterisk crashes when I attempt to register from a browser, but only after I leave the browser open for some time without registering (~1 hour).



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



More information about the asterisk-bugs mailing list