Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 105762 - Asterisk crashes with any Sipura ATA connected to AMD64 system
Summary: Asterisk crashes with any Sipura ATA connected to AMD64 system
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Stefan Knoblich (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-12 21:57 UTC by Joseph
Modified: 2005-09-13 10:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
bt full - from core (bt_full.txt,5.32 KB, text/plain)
2005-09-12 21:59 UTC, Joseph
Details
thread apply all bt - from core (thread_apply_all_bt.txt,58.94 KB, text/plain)
2005-09-12 22:00 UTC, Joseph
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph 2005-09-12 21:57:28 UTC
Asterisk 1.0.8 or 1.0.9 compile just fine on AMD64, but when I try to connect
any Sipura ATA (SPA-3000 or SPA-2002) Asterisk just crashes with output:
Killed
It seems to me it is killing Asterisk PID.

Enclosed are two process core files:
bt_full.txt
thread_apply_all_bt.txt


Reproducible: Always
Steps to Reproduce:
1.start asterisk on AMD64
2.connect any Sipura ATA to network
3.

Actual Results:  
Asterisk PID is Killed


emerge info
Portage 2.0.51.22-r2 (default-linux/amd64/2005.0, gcc-3.4.4, glibc-2.3.5-r1,
2.6.12-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.12-gentoo-r6 x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -pipe -O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon64 -pipe -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
ftp://gentoo.risq.qc.ca/ ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo
ftp://ftp.ussg.iu.edu/pub/linux/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X acl alsa apache2 arts avi berkdb bitmap-fonts cdr crypt cups curl
dvd eds emboss encode esd fam foomaticdb fortran gif gimp gimpprint gpm
gstreamer gtk gtk2 imagemagick imlib ipv6 java jpeg kde libwww lzw lzw-tiff mad
mp3 mpeg mysql ncurses nls opengl pam pdflib perl png postgres ppds python qt
quicktime readline samba scanner sdl slang spell ssl tcpd tetex tiff
truetype-fonts type1-fonts usb userlocales xine xml2 xpm xv zlib userland_GNU
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Joseph 2005-09-12 21:59:32 UTC
Created attachment 68323 [details]
bt full - from core
Comment 2 Joseph 2005-09-12 22:00:21 UTC
Created attachment 68324 [details]
thread apply all bt - from core
Comment 3 Stefan Knoblich (RETIRED) gentoo-dev 2005-09-13 08:23:44 UTC
ok, i've been abled to reproduce the problem with sipsak (thanks the information
in your backtrace)

asterisk dies while copying the tag= part from the SIP REGISTER message:

"From: <sip:820@10.0.0.104>;tag=8f217fcbf04b422do0"

the code:

                if (ast_strlen_zero(p->theirtag)) {
                        from = get_header(req, "From");
                        from = ast_strcasestr(from, "tag=");
                        if (from) {
                              from += 4;
here --->                     strncpy(p->theirtag, from, sizeof(p->theirtag)-1);
                                from = strchr(p->theirtag, ';');
                                if (from)
                                        *from = '\0';
                        }

I'm going to dig further to find the cause of this
Comment 4 Joseph 2005-09-13 10:43:56 UTC
 Changing utils.c  Line:402

ast_strcasestr:

  changing:
     return ((char *)((unsigned int)haystack + (unsigned int)(offset - u1)));

  into:
     return ((char *)((unsigned long)haystack + (unsigned long)(offset - u1)));

Fixes the problem

#Joseph