[Home]

Summary:ASTERISK-01508: * crashes on hangup UNLESS in console mode
Reporter:Samy Kamkar (samyk)Labels:
Date Opened:2004-04-29 21:09:36Date Closed:2004-09-25 02:48:29
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Asterisk will crash on the first call I make from a SIP phone out directly after I hangup.  The very odd thing is if I run asterisk with -c, it does NOT crash.  I could not produce a core file with the -g option.

For example, I can run "asterisk -c" and make calls fine.  But if I run just "asterisk" and make a call and hangup, it will crash.

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

[root@fw1 usr]# sbin/asterisk -g
[root@fw1 usr]# sbin/asterisk -rvvvgddd
Parsing /usr/local/asterisk/etc/asterisk/asterisk.conf
Asterisk CVS-04/23/04-04:02:30, Copyright (C) 1999-2004 Digium.
Written by Mark Spencer <markster@digium.com>
=========================================================================
Connected to Asterisk CVS-04/23/04-04:02:30 currently running on fw1 (pid = 2884)
   -- Remote UNIX connection
   -- Executing AGI("SIP/17602900000-8206", "lookup.agi") in new stack
   -- Launched AGI Script /usr/local/asterisk/var/lib/asterisk/agi-bin/lookup.agi
   -- AGI Script Executing Application: (Dial) Options: (SIP/18584146800@gwr1)
   -- Called 18584146800@gwr1
   -- SIP/gwr1-0465 is making progress passing it to SIP/17602900000-8206
 == Spawn extension (local, 8584146800, 1) exited non-zero on 'SIP/17602900000-8206'
   -- Executing Hangup("SIP/17602900000-8206", "") in new stack
 == Spawn extension (local, h, 1) exited non-zero on 'SIP/17602900000-8206'
fw1*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
Asterisk ending (0).
Comments:By: twisted (twisted) 2004-04-29 21:11:52

can you get a gdb bt full on this so we can find out what's causing the problem?  Also, try updating to current CVS.

By: twisted (twisted) 2004-04-29 21:12:45

sorry, if you can't produce a core with this, try attaching to the process that's running with gdb and once it enters the crash state, run a bt.

By: Brian West (bkw918) 2004-04-29 21:22:54

once it crashes you can't connect to it. :P

But I have tried to recreate this and I can't

I run asterisk fine and make calls fine, the calls go thru and no crash.

bkw

By: Brian West (bkw918) 2004-04-29 21:24:50

I even tried asterisk -g then connect to it with asterisk -rvvvgddd

Don't know wny you would do this but it didn't crash on me either.

What distro?

By: twisted (twisted) 2004-04-29 23:07:02

Also, can you post your AGI here so that we can try to emulate exactly what happens?

By: Brian West (bkw918) 2004-04-30 12:49:23

Your going to have to respond faster on these Major/Crash bugs as they are the only thing holding up 1.0-RC1 so please respond ASAP.

Thank,
Brian

By: Samy Kamkar (samyk) 2004-04-30 13:08:47

Machine info:
[root@fw1 root]# uname -a
Linux fw1 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux
[root@fw1 root]# cat /etc/redhat-release
Red Hat Linux release 9 (Shrike)
[root@fw1 root]# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 8
model name      : Pentium III (Coppermine)
stepping        : 3
cpu MHz         : 846.335
cache size      : 256 KB
physical id     : 0
siblings        : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse
bogomips        : 1684.27

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 8
model name      : Pentium III (Coppermine)
stepping        : 3
cpu MHz         : 846.335
cache size      : 256 KB
physical id     : 0
siblings        : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse
bogomips        : 1690.82



How can I attach it to the process?

[root@fw1 root]# gdb /usr/bin/asterisk
GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run
Starting program: /usr/bin/asterisk
[Thread debugging using libthread_db enabled]
[New Thread 1074418304 (LWP 3609)]

Program exited normally.

By: Matthew Nicholson (mnicholson) 2004-04-30 13:10:42

I am getting this same problem, and I have the latest cvs.

By: Samy Kamkar (samyk) 2004-04-30 15:49:22

Weird...gdb seg faulting on me

[root@fw1 asterisk]# ./asterisk
[root@fw1 asterisk]# ps auwx|grep ast
root     32613 28.0  0.8 99580 9248 ?        S    12:25   0:00 ./asterisk
root     32625  0.0  0.0  3568  624 pts/0    S    12:25   0:00 grep ast
[root@fw1 asterisk]# gdb ./asterisk 32613
GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

Attaching to program: /usr/src/asterisk/asterisk, process 32613
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/tls/libpthread.so.0...done.
[Thread debugging using libthread_db enabled]
[New Thread 1074418304 (LWP 32613)]
[New Thread 1176139840 (LWP 32623)]
[New Thread 1167751360 (LWP 32622)]
[New Thread 1159362880 (LWP 32621)]
[New Thread 1142106560 (LWP 32620)]
[New Thread 1133718080 (LWP 32619)]
[New Thread 1125329600 (LWP 32618)]
[New Thread 1116941120 (LWP 32617)]
[New Thread 1100356544 (LWP 32616)]
[New Thread 1091746880 (LWP 32615)]
[New Thread 1083358400 (LWP 32614)]
Loaded symbols for /lib/tls/libpthread.so.0
Reading symbols from /usr/lib/libncurses.so.5...done.
Loaded symbols for /usr/lib/libncurses.so.5
Reading symbols from /lib/tls/libm.so.6...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /usr/lib/libgpm.so.1...done.
Loaded symbols for /usr/lib/libgpm.so.1
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/format_wav_gsm.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/format_wav_gsm.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/format_wav.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/format_wav.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/format_pcm.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/format_pcm.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/format_gsm.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/format_gsm.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/codec_ulaw.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/codec_ulaw.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/codec_gsm.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/codec_gsm.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/codec_alaw.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/codec_alaw.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/pbx_config.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/pbx_config.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/res_musiconhold.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/res_musiconhold.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/res_parking.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/res_parking.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/chan_sip.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/chan_sip.so
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/pbx_spool.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/pbx_spool.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/res_adsi.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/res_adsi.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/app_setcallerid.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/app_setcallerid.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/chan_modem.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/chan_modem.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/chan_modem_aopen.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/chan_modem_aopen.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/app_setcidname.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/app_setcidname.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/app_dial.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/app_dial.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/app_db.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/app_db.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/cdr_csv.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/cdr_csv.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/app_agi.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/app_agi.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/res_crypto.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/res_crypto.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/chan_iax2.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/chan_iax2.so
Reading symbols from /usr/local/asterisk/usr/lib/asterisk/modules/chan_h323.so...done.
Loaded symbols for /usr/local/asterisk/usr/lib/asterisk/modules/chan_h323.so
Reading symbols from /usr/local/lib/libpt_linux_x86_r.so.1.5.2...done.
Loaded symbols for /usr/local/lib/libpt_linux_x86_r.so.1.5.2
Reading symbols from /usr/local/lib/libh323_linux_x86_r.so.1.12.2...done.
Loaded symbols for /usr/local/lib/libh323_linux_x86_r.so.1.12.2
Reading symbols from /usr/lib/libstdc++.so.5...done.
Loaded symbols for /usr/lib/libstdc++.so.5
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
0xffffe002 in ?? ()
(gdb) continue
Continuing.
[New Thread 1184528320 (LWP 32627)]

Program exited normally.
Segmentation fault

By: Samy Kamkar (samyk) 2004-04-30 15:51:32

By the way,
"[New Thread 1184528320 (LWP 32627)]"
occurred right after I made a SIP call.

Then,
"Program exited normally.
Segmentation fault"
occurred right after I hung up (I never picked up the call.)

By: Matthew Nicholson (mnicholson) 2004-04-30 16:46:12

I think this has something to do with using agi.  The calls that don't use any agi work fine, but when I have used an agi script on that extension and the call completes asterisk exits.  Like sammy said, it does not happen in console mode.

By: Malcolm Davenport (mdavenport) 2004-04-30 16:50:28

ok, does this problem occur outside of Redhat 9?

By: Matthew Nicholson (mnicholson) 2004-04-30 16:55:40

Yup RH 9...

By: Samy Kamkar (samyk) 2004-04-30 19:00:41

mnicholson, how many processors?

By: Matthew Nicholson (mnicholson) 2004-04-30 19:07:36

Two processors

By: Samy Kamkar (samyk) 2004-04-30 19:15:11

Same on my machine...I'm wondering if that is part of the problem.

By: Mark Spencer (markster) 2004-04-30 20:18:28

Have you guys tried running under valgrind to find the real cause of the crash?

By: Samy Kamkar (samyk) 2004-04-30 20:43:06

Here is the AGI I'm testing with and it is still crashing:

#!/usr/bin/perl

use strict;
use Asterisk::AGI;

my $AGI = new Asterisk::AGI;
my %input = $AGI->ReadParse();
my $ext = $input{'extension'};

$AGI->exec("Dial", "SIP/$ext\@gwr1");

By: Mark Spencer (markster) 2004-04-30 20:49:03

Can't duplicate.  Find me on irc (kram) and be prepared to provide login information.  Preferably please have valgrind already installed.

By: Mark Spencer (markster) 2004-04-30 23:07:14

It's not crashing actually, it's simply exiting.  The reason is that poll(NULL, 0, -1) actually returns (???) so we have to put it in a loop.  Fixed in CVS

By: Mark Spencer (markster) 2004-04-30 23:07:32

Fixed in CVS