Bug#630381: asterisk: sporadic segfault in chan_sip.so since 1.6.2.9-2+squeeze2

Maurice Massar massar at unix-ag.uni-kl.de
Mon Jun 13 14:36:46 UTC 2011


Package: asterisk
Version: 1:1.6.2.9-2+squeeze2
Severity: important
Tags: squeeze

hi,

our asterisk process keeps segfaulting since about over month:

[...?]
May 11 03:04:35 asterisk kernel: [ 530982.766458] asterisk[21999]: segfault at c ip 00000000f6273869 sp 00000000f54fe420 error 4 in chan_sip.so[f620b000+7e000]
[...]
Jun  9 11:55:37 asterisk kernel: [3064066.396045] asterisk[11373]: segfault at c ip 00000000f6227869 sp 00000000f5402420 error 4 in chan_sip.so[f61bf000+7e000]
Jun 10 06:54:06 asterisk kernel: [3132257.899373] asterisk[17987]: segfault at c ip 00000000f6213869 sp 00000000f58e7420 error 4 in chan_sip.so[f61ab000+7e000]
Jun 10 06:57:33 asterisk kernel: [3132464.951748] asterisk[18054]: segfault at c ip 00000000f623a869 sp 00000000f567a420 error 4 in chan_sip.so[f61d2000+7e000]
Jun 10 06:59:56 asterisk kernel: [3132607.369580] asterisk[18116]: segfault at c ip 00000000f62f0869 sp 00000000f5730420 error 4 in chan_sip.so[f6288000+7e000]
Jun 10 07:00:49 asterisk kernel: [3132660.206272] asterisk[18207]: segfault at c ip 00000000f622b869 sp 00000000f566b420 error 4 in chan_sip.so[f61c3000+7e000]
Jun 10 07:43:18 asterisk kernel: [3135205.103355] asterisk[18482]: segfault at c ip 00000000f62bf869 sp 00000000f56ff420 error 4 in chan_sip.so[f6257000+7e000]
Jun 10 07:55:58 asterisk kernel: [3135963.208988] asterisk[18585]: segfault at c ip 00000000f62d3869 sp 00000000f56d7420 error 4 in chan_sip.so[f626b000+7e000]
Jun 10 07:58:42 asterisk kernel: [     82.821256] asterisk[ 1168]: segfault at c ip 00000000f6243869 sp 00000000f5953420 error 4 in chan_sip.so[f61db000+7e000]
Jun 10 08:00:48 asterisk kernel: [    208.746595] asterisk[ 1293]: segfault at c ip 00000000f624c869 sp 00000000f595c420 error 4 in chan_sip.so[f61e4000+7e000]
Jun 10 08:25:45 asterisk kernel: [   1703.199227] asterisk[ 1483]: segfault at c ip 00000000f6294869 sp 00000000f56d4420 error 4 in chan_sip.so[f622c000+7e000]
Jun 10 08:43:14 asterisk kernel: [   2750.321637] asterisk[ 1632]: segfault at c ip 00000000f628c869 sp 00000000f56cc420 error 4 in chan_sip.so[f6224000+7e000]
Jun 10 08:44:50 asterisk kernel: [   2845.784976] asterisk[ 1687]: segfault at c ip 00000000f627c869 sp 00000000f5680420 error 4 in chan_sip.so[f6214000+7e000]
Jun 10 08:45:48 asterisk kernel: [   2903.932739] asterisk[ 1731]: segfault at c ip 00000000f623f869 sp 00000000f567f420 error 4 in chan_sip.so[f61d7000+7e000]
Jun 13 00:49:25 asterisk kernel: [ 233123.738117] asterisk[29114]: segfault at c ip 00000000f6261869 sp 00000000f5971420 error 4 in chan_sip.so[f61f9000+7e000]
Jun 13 00:50:43 asterisk kernel: [ 233201.843818] asterisk[29190]: segfault at c ip 00000000f62f2869 sp 00000000f5732420 error 4 in chan_sip.so[f628a000+7e000]

"instruction-pointer - base-address" is 0x68869 in all lines,
fetching asterisk-dbg and running addr2line:

asterisk:~$ addr2line -f -e /usr/lib/debug/usr/lib/asterisk/modules/chan_sip.so 0x68869
_sip_tcp_helper_thread
/build/buildd-asterisk_1.6.2.9-2+squeeze2-i386-uKYmpc/asterisk-1.6.2.9/channels/chan_sip.c:3200

line 3200 of channels/chan_sip.c was introduced by debian/patches/AST-2011-005-p2:
[line 3200 is the one starting "+ if (!tcptls_session->client"]

===
@@ -3074,6 +3197,10 @@ static void *_sip_tcp_helper_thread(stru
        ast_debug(2, "Shutting down thread for %s server\n", tcptls_session->ssl ? "SSL" : "TCP");

 cleanup:
+       if (!tcptls_session->client && !authenticated) {
+               ast_atomic_fetchadd_int(&unauth_sessions, -1);
+       }
+
        if (me) {
                ao2_t_unlink(threadt, me, "Removing tcptls helper thread, thread is closing");
                ao2_t_ref(me, -1, "Removing tcp_helper_threads threadinfo ref");
===

tcptls_session is a "struct ast_tcptls_session_instance", and "client"
is its fourth member, matching to segfault address 0x0000000c if
tcptls_session == NULL.

Suspiciously, a bit below in line 3222 there is an extra
"if (tcptls_session) {" test around some code...


cu
Maurice Massar

-- System Information:
Debian Release: 6.0.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages asterisk depends on:
ii  adduser            3.112+nmu2            add and remove users and groups
ii  asterisk-config    1:1.6.2.9-2+squeeze2  Configuration files for Asterisk
ii  asterisk-sounds-ma 1:1.6.2.9-2+squeeze2  Core Sound files for Asterisk (Eng
ii  dahdi              1:2.2.1.1-1           utilities for using the DAHDI kern
ii  libasound2         1.0.23-2.1            shared library for ALSA applicatio
ii  libc-client2007e   8:2007e~dfsg-3.1      c-client library for mail protocol
ii  libc6              2.11.2-10             Embedded GNU C Library: Shared lib
ii  libcap2            1:2.19-3              support for getting/setting POSIX.
ii  libcurl3           7.21.0-1              Multi-protocol file transfer libra
ii  libgcc1            1:4.4.5-8             GCC support library
ii  libglib2.0-0       2.24.2-1              The GLib library of C routines
ii  libgmime-2.0-2a    2.2.25-2              MIME library
ii  libgsm1            1.0.13-3              Shared libraries for GSM speech co
ii  libiksemel3        1.2-4                 C library for the Jabber IM platfo
ii  libjack-jackd2-0 [ 1.9.6~dfsg.1-2        JACK Audio Connection Kit (librari
ii  libldap-2.4-2      2.4.23-7              OpenLDAP libraries
ii  liblua5.1-0        5.1.4-5               Simple, extensible, embeddable pro
ii  libncurses5        5.7+20100313-5        shared libraries for terminal hand
ii  libnewt0.52        0.52.11-1             Not Erik's Windowing Toolkit - tex
ii  libogg0            1.2.0~dfsg-1          Ogg bitstream library
ii  libopenais3        1.1.2-2               Standards-based cluster framework 
ii  libopenr2-3        1.3.0-2               MFC/R2 (telephony) call setup libr
ii  libpopt0           1.16-1                lib for parsing cmdline parameters
ii  libpq5             8.4.7-0squeeze2       PostgreSQL C client library
ii  libpri1.4          1.4.11.3-1            Primary Rate ISDN specification li
ii  libradiusclient-ng 0.5.6-1.1             Enhanced RADIUS client library
ii  libresample1       0.1.3-3               real-time audio resampling library
ii  libsdl1.2debian    1.2.14-6.1            Simple DirectMedia Layer
ii  libsnmp15          5.4.3~dfsg-2          SNMP (Simple Network Management Pr
ii  libspandsp2        0.0.6~pre12-1         Telephony signal processing librar
ii  libspeex1          1.2~rc1-1             The Speex codec runtime library
ii  libspeexdsp1       1.2~rc1-1             The Speex extended runtime library
ii  libsqlite0         2.8.17-6              SQLite shared library
ii  libss7-1           1.0.2-1               Signalling System 7 (ss7) library
ii  libssl0.9.8        0.9.8o-4squeeze1      SSL shared libraries
ii  libstdc++6         4.4.5-8               The GNU Standard C++ Library v3
ii  libsybdb5          0.82-7                libraries for connecting to MS SQL
ii  libtiff4           3.9.4-5+squeeze2      Tag Image File Format (TIFF) libra
ii  libtonezone2.0     1:2.2.1.1-1           tonezone library (runtime)
ii  libvorbis0a        1.3.1-1               The Vorbis General Audio Compressi
ii  libvorbisenc2      1.3.1-1               The Vorbis General Audio Compressi
ii  libvpb0            4.2.52-2              Voicetronix telephony hardware use
ii  libx11-6           2:1.3.3-4             X11 client-side library
ii  libxml2            2.7.8.dfsg-2+squeeze1 GNOME XML library
ii  unixodbc           2.2.14p2-1            ODBC tools libraries
ii  zlib1g             1:1.2.3.4.dfsg-3      compression library - runtime

Versions of packages asterisk recommends:
pn  sox                           <none>     (no description available)

Versions of packages asterisk suggests:
pn  asterisk-dev                  <none>     (no description available)
pn  asterisk-doc                  <none>     (no description available)
pn  asterisk-h323                 <none>     (no description available)

-- Configuration Files:
/etc/default/asterisk changed [not included]

-- no debconf information





More information about the Pkg-voip-maintainers mailing list