[Home]

Summary:ASTERISK-13272: [patch] Function in iLBC conflicts with function in chan_vpb
Reporter:Michel Belleau (malaiwah)Labels:
Date Opened:2008-12-25 08:08:42.000-0600Date Closed:2009-03-20 08:25:51
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Codecs/codec_ilbc
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) gdb.txt
( 1) ilbc_extract.patch
Description:I'm running Asterisk (as test machines) under various virtual environnements and am having the same problem under every virtual environnement I tried.
I had this problem with Asterisk 1.4 before but did not bother mentionning because I did not want to use the iLBC codec at that time. I think this issue started when the iLBC source code went out-of-tree.

I'm running a Ubuntu 32-bit guest in a 64-bit server, this one is running under VMWare Server on Linux.

If I try to run Asterisk with the iLBC codec enabled (with the contrib script downloading/extracting the source from the online RFC) it segfaults. I'm currently testing it with asterisk-trunk.

I can successfully start asterisk if I add a noload directive in the modules.conf configuration file, but I'm missing the ilbc codec in the supported translations report.

In "additionnal informations", I have the gdb stacktrace (bt) of my core dump file.

****** ADDITIONAL INFORMATION ******

(gdb) bt
#0  0xb715f4a4 in window () from /usr/lib/libvpb.so.0
#1  0xb58bddde in SimpleAnalysis (lsf=0xbfb5fc1c, data=0xbfb60cb0, iLBCenc_inst=0x838b014) at LPCencode.c:50
#2  0xb58bdf62 in LPCencode (syntdenum=0xbfb61504, weightdenum=0xbfb613fc, lsf_index=0xbfb61694, data=0xbfb60cb0, iLBCenc_inst=0x838b014) at LPCencode.c:229
#3  0xb58b8f4a in iLBC_encode (bytes=0x83903e8 "", block=0xbfb6170c, iLBCenc_inst=0x838b014) at iLBC_encode.c:134
#4  0xb58b7267 in lintoilbc_frameout (pvt=0x838afa0) at codec_ilbc.c:148
ASTERISK-1  0x0813dbdc in calc_cost (t=0xb58c2c20, seconds=1) at translate.c:422
ASTERISK-2  0x0813e43b in __ast_register_translator (t=0xb58c2c20, mod=0x83934b0) at translate.c:672
ASTERISK-3  0xb58b73cc in load_module () at codec_ilbc.c:202
ASTERISK-4  0x080d836e in load_resource (resource_name=0x83512f0 "codec_ilbc.so", global_symbols_only=0) at loader.c:694
ASTERISK-5  0x080d9142 in ?? ()
ASTERISK-6 0x0807a579 in ?? ()
ASTERISK-7 0xb6e41450 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
ASTERISK-8 0x0805fa41 in ?? ()
(gdb) quit
root@shinypulse:/usr/src/asterisk-trunk# svn info
Path: .
URL: http://svn.digium.com/svn/asterisk/trunk
Repository Root: http://svn.digium.com/svn/asterisk
Repository UUID: f38db490-d61c-443f-a65b-d21fe96a405b
Revision: 166771
Node Kind: directory
Schedule: normal
Last Changed Author: twilson
Last Changed Rev: 166731
Last Changed Date: 2008-12-24 10:10:42 -0500 (mer, 24 déc 2008)

root@shinypulse:/usr/src/asterisk-trunk# uname -a
Linux shinypulse 2.6.24-22-virtual #1 SMP Mon Nov 24 19:55:07 UTC 2008 i686 GNU/Linux
root@shinypulse:/usr/src/asterisk-trunk#
Comments:By: Michel Belleau (malaiwah) 2008-12-25 08:19:25.000-0600

Sorry, my backtrace in add'l informations is not correct, this build was not done using "DONT_OPTIMIZE".
I will post the correct gdb output as a file attachment (gdb.txt).

Core was generated by `asterisk -vvvvvvvvvdddgc'.
Program terminated with signal 11, Segmentation fault.

(gdb) bt
#0  0xb70f04a4 in window () from /usr/lib/libvpb.so.0
#1  0xb5819800 in SimpleAnalysis (lsf=0xbfb2ddd0, data=0xbfb2eda8, iLBCenc_inst=0x83a54ec) at LPCencode.c:50
#2  0xb5819da5 in LPCencode (syntdenum=0xbfb2f5fc, weightdenum=0xbfb2f4f4, lsf_index=0xbfb2f78c, data=0xbfb2eda8, iLBCenc_inst=0x83a54ec) at LPCencode.c:229
#3  0xb5814db3 in iLBC_encode (bytes=0x83aa8c0 "", block=0xbfb2f834, iLBCenc_inst=0x83a54ec) at iLBC_encode.c:134
#4  0xb58132ed in lintoilbc_frameout (pvt=0x83a5478) at codec_ilbc.c:148
ASTERISK-1  0x081507b4 in calc_cost (t=0xb581ea60, seconds=1) at translate.c:422
ASTERISK-2  0x081517ae in __ast_register_translator (t=0xb581ea60, mod=0x840ff08) at translate.c:672
ASTERISK-3  0xb5813429 in load_module () at codec_ilbc.c:202
ASTERISK-4  0x080e20fe in load_resource (resource_name=0x836c3e0 "codec_ilbc.so", global_symbols_only=0) at loader.c:694
ASTERISK-5  0x080e2a71 in ?? ()
ASTERISK-6 0x08080b7e in ?? ()
ASTERISK-7 0xb6dd2450 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
ASTERISK-8 0x0805fbb1 in ?? ()

By: Michel Belleau (malaiwah) 2008-12-25 08:29:36.000-0600

The backtrace seems to originate from VPB drivers (linvpb.so.0 in the window() function), but I don't any VPB card.

root@shinypulse:/usr/src/asterisk-trunk# dpkg -l | grep vpb0 && apt-cache show libvpb0 && apt-cache show asterisk
ii  libvpb0                                4.2.23-1                     Voicetronix telephony hardware userspace int
Package: libvpb0
Priority: optional
Section: universe/libs
Installed-Size: 560
Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
Original-Maintainer: Ron Lee <ron@debian.org>
Architecture: i386
Source: vpb-driver
Version: 4.2.23-1
Depends: libc6 (>= 2.7-1), libgcc1 (>= 1:4.1.1-21), libstdc++6 (>= 4.1.1-21), zlib1g (>= 1:1.2.3.3.dfsg-1)
Recommends: vpb-driver-source
Suggests: vpb-utils
Filename: pool/universe/v/vpb-driver/libvpb0_4.2.23-1_i386.deb
Size: 190914
MD5sum: 4681b2bd926962cd7e3634316481361a
SHA1: d16dc58f6546ada2e4151be4fb4429c2a817f40e
SHA256: b205d351d2da76ea233a316196ec2916061358b3adc1f9aafef0f74fbad6e68f
Description: Voicetronix telephony hardware userspace interface library
This package provides the user space support library for Voicetronix telephony
hardware.
Bugs: mailto:ubuntu-users@lists.ubuntu.com
Origin: Ubuntu

Package: asterisk
Priority: optional
Section: universe/comm
Installed-Size: 5888
Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
Original-Maintainer: Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>
Architecture: i386
Version: 1:1.4.17~dfsg-2ubuntu1
Replaces: asterisk-bristuff, asterisk-classic
Provides: asterisk-bristuff, asterisk-classic
Depends: adduser, asterisk-config (= 1:1.4.17~dfsg-2ubuntu1) | asterisk-config-custom, asterisk-sounds-main, libasound2 (>> 1.0.14), libc-client2007, libc6 (>= 2.4), libcap1, libct3 (>= 0.63-1), libcurl3 (>= 7.16.2-1), libgcc1 (>= 1:4.1.1-21), libgsm1 (>= 1.0.12), libiksemel3, libkrb53 (>= 1.6.dfsg.2), libncurses5 (>= 5.6+20071006-3), libnewt0.52, libogg0 (>= 1.0rc3), libpopt0 (>= 1.10), libpq5 (>= 8.3~beta1), libpri1.0 (>= 1.4), libradiusclient-ng2, libsnmp15 (>= 5.4.1~dfsg), libspeex1 (>= 1.1.8), libsqlite0 (>= 2.8.17), libssl0.9.8 (>= 0.9.8f-1), libstdc++6 (>= 4.1.1-21), libtonezone1 (>= 1:1.4.8~dfsg), libvorbis0a (>= 1.2.0), libvorbisenc2 (>= 1.1.2), libvpb0 (>= 4.2.23), unixodbc (>= 2.2.11-1), zlib1g (>= 1:1.2.3.3.dfsg-1)
Suggests: asterisk-dev, asterisk-doc, asterisk-h323, ekiga, kphone, ohphone, twinkle
Conflicts: asterisk-bristuff, asterisk-classic
Filename: pool/universe/a/asterisk/asterisk_1.4.17~dfsg-2ubuntu1_i386.deb
Size: 2317974
MD5sum: a4f7a17b301847c94f12afffcd7a4d9c
SHA1: e9af3c6c146807f77661dfb4853f30e48dbae258
SHA256: 7f6571fe8dce406f93f47710dda35b833fb7253617da78000c742332fc3689fc
Description: Open Source Private Branch Exchange (PBX)
Asterisk is an Open Source PBX and telephony toolkit.  It is, in a
sense, middleware between Internet and telephony channels on the bottom,
and Internet and telephony applications at the top.
.
Asterisk can be used with Voice over IP (SIP, H.323, IAX and more) standards,
or the Public Switched Telephone Network (PSTN) through supported hardware.
.
Supported hardware:
.
 * All Wildcard (tm) ISDN PRI cards from Digium (http://www.digium.com)
 * HFC-S/HFC-4S-based ISDN BRI cards (Junghanns.NET, beroNet, Digium etc.)
 * All TDM (FXO/FXS) cards from Digium
 * Various clones of Digium cards such as those by OpenVox
 * Xorcom Astribank USB telephony adapter (http://www.xorcom.com)
 * Voicetronix OpenPCI, OpenLine and OpenSwitch cards
 * CAPI-compatible ISDN cards (using the add-on package chan-capi)
 * Full Duplex Sound Card (ALSA or OSS) supported by Linux
 * Tormenta T1/E1 card (http://www.zapatatelephony.org)
 * QuickNet Internet PhoneJack and LineJack (http://www.quicknet.net)
.
This is the main package that includes the Asterisk daemon and most channel
drivers and applications.
Homepage: http://www.asterisk.org/
Bugs: mailto:ubuntu-users@lists.ubuntu.com
Origin: Ubuntu

By: Michel Belleau (malaiwah) 2008-12-25 08:37:13.000-0600

So LIBVPB was installed as a dependency when my test machine first was installed with 1.4.17 from the Ubuntu repositories.
I since upgraded it to svn-trunk by hand.
I did not un-select chan_vpb in menuselect, so I'm unselecting it now just so I know if this is what breaks my setup.

This might not be related to my test machines running on any virtualization engine afterall, it might only be bad luck because the asterisk server that I have on a dedicated machine does not have this vpb package installed.

By: Michel Belleau (malaiwah) 2008-12-25 08:49:01.000-0600

Unselecting chan_vpb in menuselect did not fix the problem so I changed the ilbc source code renaming their window() function to ilbc_window(). I'm recompiling to see if that fixes the problem.

By: Michel Belleau (malaiwah) 2008-12-25 09:05:39.000-0600

changing the ilbc function name works like a charm, looks like there was a confusion between the window() function of VPB and the one of iLBC.

I can now use iLBC on my asterisk server.

*CLI> core show translation recalc 60
        Recalculating Codec Translation (number of sample seconds: 60)

        Translation times between formats (in microseconds) for one second of data
         Source Format (Rows) Destination Format (Columns)

          g723   gsm  ulaw  alaw g726aal2 adpcm  slin lpc10  g729 speex  ilbc  g726  g722 slin16
    g723     -  1134     2     2        2     2     1  1801     2 11068  4667     2     2      3
     gsm  3466     -   467   467      467   467   466  2266   467 11533  5132   467   467    468
    ulaw  3001  1134     -     1        2     2     1  1801     2 11068  4667     2     2      3
    alaw  3001  1134     1     -        2     2     1  1801     2 11068  4667     2     2      3
g726aal2  3001  1134     2     2        -     2     1  1801     2 11068  4667     1     2      3
   adpcm  3001  1134     2     2        2     -     1  1801     2 11068  4667     2     2      3
    slin  3000  1133     1     1        1     1     -  1800     1 11067  4666     1     1      2
   lpc10  4666  2799  1667  1667     1667  1667  1666     -  1667 12733  6332  1667  1667   1668
    g729  3001  1134     2     2        2     2     1  1801     - 11068  4667     2     2      3
   speex  3001  1134     2     2        2     2     1  1801     2     -  4667     2     2      3
    ilbc  3001  1134     2     2        2     2     1  1801     2 11068     -     2     2      3
    g726  3001  1134     2     2        1     2     1  1801     2 11068  4667     -     2      3
    g722  3001  1134     2     2        2     2     1  1801     2 11068  4667     2     -      1
  slin16  3002  1135     3     3        3     3     2  1802     3 11069  4668     3     1      -

By: Michel Belleau (malaiwah) 2008-12-25 09:12:19.000-0600

I uploaded a patch to the contrib/scripts/get_ilbc_source.sh file for replacing window() by ilbc_window() so that people with the Voicetronix API (VPB) can still use the iLBC codec with Asterisk and that those two functions do not overlap each other.

By: Michel Belleau (malaiwah) 2008-12-25 09:14:38.000-0600

Please change the title of this bug report so that it does not mention Xen/Vmware as this was unrelated to the problem; it's just that my new test machines under vmware/xen were all using Ubuntu (that makes libvpb0 a dependency of asterisk) and that my dedicated asterisk test machine was not having this dependency (old gentoo installation)

By: Jason Parker (jparker) 2009-03-17 15:47:54

Please try this branch: http://svn.digium.com/svn/asterisk/team/kpfleming/symbol-namespace-cleanup/

This is an attempt to solve these types of issues.

By: Russell Bryant (russell) 2009-03-20 08:25:51

The namespace cleanup branch has been merged into 1.4 and trunk.  These issues should be resolved.

Thanks!