Segmentation fault and no core

Hello,
I am getting frequent segmentation fault when starting asterisk, by frequent I mean ~ 7 out of 10 manual start ends in seg fault .
Then it is not clear to me why sometimes it start and others it fails

from wiki.asterisk.org/wiki/display/ … +Backtrace I read that adding a -g to the asterisk command should produce a core dump , unfortunatly it doesn’t for me :frowning:

Can you guide me to a procedure to figure out what is wrong ?
here’s how I test a start
root@toip1:~# asterisk -U asterisk -g -cv

I run on:
root@toip1:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 6.0.5 (squeeze)
Release: 6.0.5
Codename: squeeze

arch

x86_64

dpkg -l | grep asterisk

ii asterisk 1:1.8.11.1-1digium1~squeeze Open Source Private Branch Exchange (PBX)
ii asterisk-config 1:1.8.11.1-1digium1~squeeze Configuration files for Asterisk
ii asterisk-core-sounds-en-gsm 1.4.21-1digium1~squeeze asterisk PBX sound files - English/gsm
ii asterisk-dahdi 1:1.8.11.1-1digium1~squeeze DAHDI devices support for the Asterisk PBX
ii asterisk-moh-opsound-wav 2.03-1 asterisk extra sound files - English/wav
ii asterisk-voicemail 1:1.8.11.1-1digium1~squeeze simple voicemail support for the Asterisk PBX

when it occationnaly starts, I have:
*CLI> core show sysinfo

System Statistics

System Uptime: 29 hours
Total RAM: 33006520 KiB
Free RAM: 32020812 KiB
Buffer RAM: 83112 KiB
Total Swap Space: 34996216 KiB
Free Swap Space: 34996216 KiB

Number of Processes: 257

*CLI> core show version
Asterisk 1.8.11.1-1digium1~squeeze built by pbuilder @ nighthawk on a x86_64 running Linux on 2012-04-25 17:23:34 UTC
*CLI> module show
Module Description Use Count
res_calendar.so Asterisk Calendar integration 4

res_convert.so File format conversion CLI command 0
227 modules loaded
*CLI> dahdi show status
Description Alarms IRQ bpviol CRC Fra Codi Options LBO
wanpipe1 card 0 RED 0 0 0 CCS HDB3 CRC4 0 db (CSU)/0-133 feet (DSX-1)
wanpipe2 card 1 RED 0 0 0 CCS HDB3 CRC4 0 db (CSU)/0-133 feet (DSX-1)
wanpipe3 card 2 RED 0 0 0 CCS HDB3 CRC4 0 db (CSU)/0-133 feet (DSX-1)
wanpipe4 card 3 RED 0 0 0 CCS HDB3 CRC4 0 db (CSU)/0-133 feet (DSX-1)

thanks for any advice .

Are you running it non-root?

Is the directory you start in in one that allows files to be created?

Do you have any obsolete modules?

ok, I moved to asterisk’s home dir to start it
indeed now there is a core (dump) file created

Below is how I started it, and a selection of relevant warnings and errors from the verbose argument:

root@toip1:/var/lib/asterisk# asterisk -U asterisk -g -cv
Asterisk 1.8.11.1-1digium1~squeeze, Copyright © 1999 - 2012 Digium, Inc. and others.

Running as user 'asterisk’
Asterisk Dynamic Loader Starting:

[Sep 26 10:34:44] ERROR[23236]: res_config_ldap.c:1658 parse_config: No directory URL or host found.
[Sep 26 10:34:44] ERROR[23236]: res_config_ldap.c:1541 load_module: Cannot load LDAP RealTime driver.

[Sep 26 10:34:44] WARNING[23236]: chan_dahdi.c:17887 process_dahdi: Ignoring any changes to ‘hasmanager’ (on reload) at line 47.

[Sep 26 10:34:44] ERROR[23236]: ais/clm.c:140 ast_ais_clm_load_module: Could not initialize cluster membership service: Try Again

[Sep 26 10:34:44] ERROR[23236]: codec_dahdi.c:579 find_transcoders: Failed to open /dev/dahdi/transcode: No such file or directory

func_sha1.so => (SHA-1 computation dialplan function)
Erreur de segmentation (core dumped)

Now I have
-rw------- 1 asterisk asterisk 45924352 26 sept. 10:34 core

I followed backtrack recomendations:

root@toip1:/var/lib/asterisk# gdb -se “asterisk” -ex “bt full” -ex “thread apply all bt” --batch -c core > /tmp/backtrace.txt
warning: Can’t read pathname for load map: Erreur d’entrée/sortie.

root@toip1:/var/lib/asterisk# gdb -se “asterisk” -c core | tee /tmp/backtrace.txt

Loaded symbols for /usr/lib/asterisk/modules/res_convert.so
Core was generated by `asterisk -U asterisk -g -cv’.
Program terminated with signal 11, Segmentation fault.
#0 0x00007fe874fe8702 in ?? () from /lib/libc.so.6
(gdb) bt
#0 0x00007fe874fe8702 in ?? () from /lib/libc.so.6
#1 0x00007fe859a09b81 in vpb_read_confll(CONF_INFO*) () from /usr/lib/libvpb.so.0
#2 0x00007fe859a17819 in VPBRegister::VPBRegister() () from /usr/lib/libvpb.so.0
#3 0x00007fe859a0dfbc in ?? () from /usr/lib/libvpb.so.0
#4 0x00007fe859a0ebe9 in vpb_get_num_cards() () from /usr/lib/libvpb.so.0
#5 0x00007fe859c5d9e0 in ?? () from /usr/lib/asterisk/modules/chan_vpb.so
#6 0x00000000004b11a7 in ?? ()
#7 0x00000000004b1852 in ?? ()
#8 0x00000000004b1c35 in ?? ()
#9 0x000000000043929d in ?? ()
#10 0x00007fe874fcfc8d in __libc_start_main () from /lib/libc.so.6
#11 0x0000000000422299 in ?? ()
#12 0x00007fff933653b8 in ?? ()
#13 0x000000000000001c in ?? ()
#14 0x0000000000000005 in ?? ()
#15 0x00007fff93366e79 in ?? ()
#16 0x00007fff93366e82 in ?? ()
#17 0x00007fff93366e85 in ?? ()
#18 0x00007fff93366e8e in ?? ()
#19 0x00007fff93366e91 in ?? ()
#20 0x0000000000000000 in ?? ()

then issued

(gdb) thread apply all bt

Thread 45 (Thread 23271):
#0 0x00007fe8750759d3 in poll () from /lib/libc.so.6
#1 0x00007fe8574e71aa in ?? () from /usr/lib/asterisk/modules/chan_dahdi.so
#2 0x00000000005140da in ?? ()
#3 0x00007fe8746428ca in start_thread () from /lib/libpthread.so.0
#4 0x00007fe87508092d in clone () from /lib/libc.so.6
#5 0x0000000000000000 in ?? ()

Thread 1 (Thread 23236):
#0 0x00007fe874fe8702 in ?? () from /lib/libc.so.6
#1 0x00007fe859a09b81 in vpb_read_confll(CONF_INFO*) () from /usr/lib/libvpb.so.0
#2 0x00007fe859a17819 in VPBRegister::VPBRegister() () from /usr/lib/libvpb.so.0
#3 0x00007fe859a0dfbc in ?? () from /usr/lib/libvpb.so.0
#4 0x00007fe859a0ebe9 in vpb_get_num_cards() () from /usr/lib/libvpb.so.0
#5 0x00007fe859c5d9e0 in ?? () from /usr/lib/asterisk/modules/chan_vpb.so
#6 0x00000000004b11a7 in ?? ()
#7 0x00000000004b1852 in ?? ()
#8 0x00000000004b1c35 in ?? ()
#9 0x000000000043929d in ?? ()
#10 0x00007fe874fcfc8d in __libc_start_main () from /lib/libc.so.6
#11 0x0000000000422299 in ?? ()

From there, how can I determined which modules (or whatever else) created the seg fault ?

Thanks .

Is vbp new, or third party? If third party, are you sure it matches the version of Asterisk you are using?

What happens if you remove it from the configuration?

before removing it, when it eventually starts (3 out of 10 times, it still strange that it works sometime !?)
I do have :
*CLI> module show like vpb
Module Description Use Count
chan_vpb.so Voicetronix API driver 0
1 modules loaded

Now I removed the load of that module from modules.conf :
noload => chan_vpb.so

and it starts fine :wink:
don’t know what this module is used for … but I hope it won’t prevent me from using my dahdi sangoma board !?

dahdi_hardware

pci:0000:0a:04.0 wanpipe- 1923:0100 Sangoma Technologies Corp. A104d QUAD T1/E1 AFT card

thanks .