[Home]

Summary:ASTERISK-09878: Encore Bluetooth Dongle: ENUBT-C1E (class1) No voice, crash on hangup
Reporter:Steve Murphy (murf)Labels:
Date Opened:2007-07-14 11:08:51Date Closed:2011-06-07 14:01:00
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Addons/chan_mobile
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:With the Encore Class 1 Bluetooth dongle ENUBT-C1E, with asterisk calling out
thru a paired Samsung "Wafer" using Dial(), we get a faintly crackly audio, and no voice from the other end after it successfully dials out. Asterisk seems to
give up and hangup, and crashes in the process. The phone seems to time out on
the bluetooth connection, and you can carry on the conversation on the cellphone.

We end up dying in ast_translator_free_path.


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

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1251464272 (LWP 31805)]
0x080f81be in ast_translator_free_path (p=0x40) at translate.c:249
249                     pn = p->next;
(gdb) where
#0  0x080f81be in ast_translator_free_path (p=0x40) at translate.c:249
#1  0x0807dfbf in free_translation (clone=0x825f760) at channel.c:1595
#2  0x0807e126 in ast_hangup (chan=0x825f760) at channel.c:1630
#3  0xb6c0be9e in hanguptree (outgoing=0x8233858, exception=0x0, answered_elsewhere=0) at app_dial.c:331
#4  0xb6c127a2 in dial_exec_full (chan=0x825ec20, data=0xb567fa38, peerflags=0xb567d8a4, continue_exec=0x0) at app_dial.c:1811
ASTERISK-1  0xb6c128e3 in dial_exec (chan=0x825ec20, data=0xb567fa38) at app_dial.c:1833
ASTERISK-2  0x080bc13a in pbx_exec (c=0x825ec20, app=0x8249218, data=0xb567fa38) at pbx.c:562
ASTERISK-3  0x080bf1cc in pbx_extension_helper (c=0x825ec20, con=0x0, context=0x825edac "extension", exten=0x825edfc "844", priority=1, label=0x0, callerid=0x8230138 "152", action=E_SPAWN)
   at pbx.c:1785
ASTERISK-4  0x080c0460 in ast_spawn_extension (c=0x825ec20, context=0x825edac "extension", exten=0x825edfc "844", priority=1, callerid=0x8230138 "152") at pbx.c:2276
ASTERISK-5  0x080c0865 in __ast_pbx_run (c=0x825ec20) at pbx.c:2363
ASTERISK-6 0x080c16f9 in ast_pbx_run (c=0x825ec20) at pbx.c:2618
ASTERISK-7 0xb6e5e720 in ss_thread (data=0x825ec20) at chan_zap.c:6246
ASTERISK-8 0x080fec86 in dummy_start (data=0x8233848) at utils.c:546
ASTERISK-9 0xb7df0341 in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
ASTERISK-10 0xb7c2f4ee in clone () from /lib/tls/i686/cmov/libc.so.6
Comments:By: Dave Bowerman (dbowerman) 2007-08-26 00:16:42

needs testing with latest addons trunk

By: Dave Bowerman (dbowerman) 2007-09-07 20:33:36

murf, had a chance to retest yet?

By: Steve Murphy (murf) 2007-09-14 22:33:06

Yes, just ran tests after updating and installing.

My setup: I have two phone systems running; one is my trunk-installed test system, with a bluetooth dongle in it, and a tdm2400 card with a couple modules in it, hooked up to a small array of analog phones.

The other phone system is an asterisk-1.4 based system that is hooked up to the telco with some fairly ancient 100p fxo cards.

I have a couple sip hardphones, that are registered to both systems.

Incoming call went OK, sound in both directions was OK. But after hangup,
all my zaptel phones on the wctdm24xxp were offline. No dialtone.

had to reload the modules and restart asterisk. Simply restarting asterisk
does not restore the wctdm24xxp lines to operation. This is strange, because
in this call setup, no zaptel lines are used on the test system. Only on the home phone system!

Outgoing call didn't go so well. I pick up a zap extension, and dial 844,
which triggers a Dial to a local movie line. The Dial command ran OK, and
the local movie line was called, but the sound was coming out of the cellphone, not into/thru asterisk. When I hung up the extension, the cell phone was hung up also.  The zaptel lines are OK after the dialout.

So, I tried dialing in again. I pick up a sip phone and dial my cellphone via an fxo interface to the phone company. The cellphone rings once and I'm immediately connected to asterisk, and a short announcement, and then I dial another sip phone. When I answer, all is well, both sides can hear each other. Zap phones get dialtone. But after I hang up the sip phones that were involved in the cellphone conversation, the zaptel lines are dead.

What on earth is going on? Is the conversation thru the fxo interface throwing the whole zaptel wctdm24xxp into a tizzy?

So, with the zaptel fxs extensions still in a non-functional state, I try to dial out over the fxo interface again to my cell phone. All works fine. I get out the phone systems' fxo interface to the phone company. I ring my cell phone. Asterisk responds and I get in, the announcement, and the Dial to the other (sip) extension works fine. Not having the zaptel lines available doesn't seem to harm this scenario.

After rmmod'ing the wctdm24xxp and modprobing it back, and ztcfg'ing, I try dialling 844 from a zaptel phone on the 2400P. All goes well, and I can hear the movie announcement via asterisk, like I should. I have really lousy reception out here, maybe that's a factor.

By: Dave Bowerman (dbowerman) 2007-09-14 23:13:38

blimey!

do you think chan-mobile is somehow affecting zaptel? (not that i can see how..) I have a similar setup, but with TDM400P and a mix of fxo and fxs and ive not seen anything like this.

By: Steve Murphy (murf) 2007-09-17 13:42:45

I really have no idea (at the moment) of a way to attack this problem, so I decided to "go to the basics", and use valgrind to see if there's anything funky going on in the software...

And, during the chan_mobile load, I get:

==4828==
==4828== Conditional jump or move depends on uninitialised value(s)
==4828==    at 0x701900F: hci_for_each_dev (in /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x7019101: hci_get_route (in /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x700A2BD: ??? (chan_mobile.c:1951)
==4828==    by 0x80C3B2A: load_resource (loader.c:662)
==4828==    by 0x80C441C: load_modules (loader.c:854)
==4828==    by 0x8074D58: main (asterisk.c:2937)
==4828==
==4828== Syscall param socketcall.bind(my_addr.) points to uninitialised byte(s)
==4828==    at 0x4000772: (within /lib/ld-2.3.6.so)
==4828==    by 0x700A2CB: ??? (chan_mobile.c:1952)
==4828==    by 0x80C3B2A: load_resource (loader.c:662)
==4828==    by 0x80C441C: load_modules (loader.c:854)
==4828==    by 0x8074D58: main (asterisk.c:2937)
==4828==  Address 0xBEAEAF4A is on thread 1's stack
==4828==
==4828== Conditional jump or move depends on uninitialised value(s)
==4828==    at 0x700A2D3: ??? (chan_mobile.c:1953)
==4828==    by 0x80C3B2A: load_resource (loader.c:662)
==4828==    by 0x80C441C: load_modules (loader.c:854)
==4828==    by 0x8074D58: main (asterisk.c:2937)
 == Parsing '/etc/asterisk/mobile.conf':   == Found
==4828==
==4828== Conditional jump or move depends on uninitialised value(s)
==4828==    at 0x701900F: hci_for_each_dev (in /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x701937E: hci_devid (in /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x7009860: ??? (chan_mobile.c:1773)
==4828==    by 0x700A328: ??? (chan_mobile.c:1960)
==4828==    by 0x80C3B2A: load_resource (loader.c:662)
==4828==    by 0x80C441C: load_modules (loader.c:854)
==4828==    by 0x8074D58: main (asterisk.c:2937)
==4828==
==4828== Syscall param socketcall.bind(my_addr.) points to uninitialised byte(s)
==4828==    at 0x4000772: (within /lib/ld-2.3.6.so)
==4828==    by 0x7009874: ??? (chan_mobile.c:1774)
==4828==    by 0x700A328: ??? (chan_mobile.c:1960)
==4828==    by 0x80C3B2A: load_resource (loader.c:662)
==4828==    by 0x80C441C: load_modules (loader.c:854)
==4828==    by 0x8074D58: main (asterisk.c:2937)
==4828==  Address 0xBEAEAEAA is on thread 1's stack
==4828==
==4828== Conditional jump or move depends on uninitialised value(s)
==4828==    at 0x7009884: ??? (chan_mobile.c:1776)
==4828==    by 0x700A328: ??? (chan_mobile.c:1960)
==4828==    by 0x80C3B2A: load_resource (loader.c:662)
==4828==    by 0x80C441C: load_modules (loader.c:854)
==4828==    by 0x8074D58: main (asterisk.c:2937)
[Sep 17 07:30:51] ERROR[4832]: chan_mobile.c:1777 mbl_load_config: Unable to open adapter iogear_gbu221. It wont be enabled.
[Sep 17 07:30:51] ERROR[4832]: chan_mobile.c:1777 mbl_load_config: Unable to open adapter asus. It wont be enabled.
==4828==
==4828== Invalid read of size 1
==4828==    at 0x401E398: memcpy (mac_replace_strmem.c:394)
==4828==    by 0x701EFC9: sdp_gen_pdu (in /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x701FADB: sdp_append_to_pdu (in /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x701FB23: (within /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x701C025: sdp_gen_record_pdu (in /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x701E306: sdp_device_record_register (in /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x701E4AF: sdp_record_register (in /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x70070D4: ??? (chan_mobile.c:1150)
==4828==    by 0x700A379: ??? (chan_mobile.c:1965)
==4828==    by 0x80C3B2A: load_resource (loader.c:662)
==4828==    by 0x80C441C: load_modules (loader.c:854)
==4828==    by 0x8074D58: main (asterisk.c:2937)
==4828==  Address 0x5ED62E5 is 0 bytes after a block of size 13 alloc'd
==4828==    at 0x401C422: malloc (vg_replace_malloc.c:149)
==4828==    by 0x701BA63: sdp_data_alloc_with_length (in /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x701BC5C: sdp_data_alloc (in /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x701E4DE: sdp_attr_add_new (in /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x701E77D: sdp_set_info_attr (in /usr/lib/libbluetooth.so.1.0.24)
==4828==    by 0x7007033: ??? (chan_mobile.c:1145)
==4828==    by 0x700A379: ??? (chan_mobile.c:1965)
==4828==    by 0x80C3B2A: load_resource (loader.c:662)
==4828==    by 0x80C441C: load_modules (loader.c:854)
==4828==    by 0x8074D58: main (asterisk.c:2937)
 == Registered application 'MobileStatus'
 == Registered application 'MobileSendSMS'
 == Registered channel type 'Mobile' (Bluetooth Mobile Device Channel Driver)                                                                                                            

I don't know if any of the above might affect anything.... I checked, and
the io_pipe array is not initialized when the pvt struct is created. While this might not mean anything, it **is** good form to initialize all fields, just in case....

valgrind reports several such violations in various places thru-out asterisk; one in the sqlite interface is particularly disturbing... the trouble with memory  issues, is that a problem in a far-away, unrelated chunk of code can affect your code in unpredictable ways...

By: Dave Bowerman (dbowerman) 2007-09-17 20:08:23

so this issue is only with that adapter?

also, what kernel version and bluez-libs version are you using?

By: Dave Bowerman (dbowerman) 2007-09-28 19:48:10

murf?

By: Steve Murphy (murf) 2007-10-03 17:06:01

Sorry for the wait; I'm not getting the usual email messages when there's an update on the bug, for some reason.

I'm on ubuntu, been doing occasional apt-get upgrade's.


Let me check the bluez that I got... hmmm. Any preferred method for finding this out? I use apt-cache showpkg, and get:

[871]/usr/src Yes, Master? apt-cache showpkg bluez-utils
Package: bluez-utils
Versions:
2.24-0ubuntu6(/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_dapper_main_binary-i386_Packages)(/var/lib/dpkg/status)

Reverse Depends:
 ubuntu-desktop,bluez-utils
 kubuntu-desktop,bluez-utils
 edubuntu-desktop,bluez-utils
 grml-btnet,bluez-utils
 bluez-btsco,bluez-utils
 bluemon,bluez-utils
 ubuntu-desktop,bluez-utils
 kubuntu-desktop,bluez-utils
 kdebluetooth,bluez-utils
 edubuntu-desktop,bluez-utils
 bluez-pcmcia-support,bluez-utils 2.24-0ubuntu6
Dependencies:
2.24-0ubuntu6 - libbluetooth1 (2 2.15) libc6 (2 2.3.4-1) libdbus-1-2 (2 0.60) libusb-0.1-4 (2 2:0.1.10a) sysvinit (2 2.80-1) module-init-tools (16 (null)) modutils (0 (null)) lsb-base (2 1.3-9ubuntu3) python-gtk2 (0 (null)) python2.2 (0 (null)) bluez-firmware (0 (null)) bluez-sdp (1 1.5-2) bluez-pan (0 (null)) bluez-sdp (1 1.5-2) bluez-pan (0 (null))
Provides:
2.24-0ubuntu6 -


So far, this is the only adapter I have, that demonstrates this problem.
I foolishly loaned on of my adapters to one of my sons, and he took it with him to college! So, maybe I'll get it back for thanksgiving...! (But not this one, luckily).

By: Joshua C. Colp (jcolp) 2008-01-15 21:43:51.000-0600

I'm suspending this for now since 1. Some adaptors just suck 2. Some bluez libs version just suck. If either of you want to pursue this, hop on and make it so.