[Home]

Summary:ASTERISK-15385: [regression] chan_local audio crash
Reporter:John Hass (john8675309)Labels:
Date Opened:2010-01-01 09:32:53.000-0600Date Closed:2010-01-06 09:22:43.000-0600
Priority:CriticalRegression?Yes
Status:Closed/CompleteComponents:Applications/app_mp3
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bt200991.txt
( 1) btfull.txt
( 2) extensions.conf
( 3) startmusic.pl
Description:Starting with asterisk 1.4.26 we started experiencing crashes whenever we did an originate from a local channel that played audio.

The trunk 237133
no longer crashes, but it only starts 1/2 of the call (line 998)  I will attach my dial plan and core dumps from earlier versions.
Comments:By: John Hass (john8675309) 2010-01-01 09:35:57.000-0600

Here is the backtrace

#0  0x00007f03308d31b0 in strlen () from /lib/libc.so.6
(gdb) bt
#0  0x00007f03308d31b0 in strlen () from /lib/libc.so.6
#1  0x000000000046049c in ast_frdup (f=0x4eee80) at frame.c:500
#2  0x000000000043c11e in __ast_queue_frame (chan=0x14ed3f0, fin=0x4eee80, head=0, after=0x0) at channel.c:921
#3  0x00007f03211f8d1e in local_queue_frame (p=0x14eb330, isoutbound=0, f=0x7f031184d620, us=<value optimized out>, us_locked=<value optimized out>) at chan_local.c:211
#4  0x00007f03211f90ff in local_write (ast=0x14ece90, f=0x7f031184d620) at chan_local.c:330
ASTERISK-1  0x0000000000441acc in ast_write (chan=0x14ece90, fr=0x7f031184d620) at channel.c:3004
ASTERISK-2  0x00007f031afb550b in mp3_exec (chan=0x14ece90, data=<value optimized out>) at app_mp3.c:209
ASTERISK-3  0x0000000000485739 in pbx_exec (c=0x14ece90, con=<value optimized out>, context=0x14ed0e0 "default", exten=0x14ed130 "999", priority=1, label=<value optimized out>, callerid=0x14ea550 "999", action=E_SPAWN) at pbx.c:536
ASTERISK-4  pbx_extension_helper (c=0x14ece90, con=<value optimized out>, context=0x14ed0e0 "default", exten=0x14ed130 "999", priority=1, label=<value optimized out>, callerid=0x14ea550 "999", action=E_SPAWN) at pbx.c:1863
ASTERISK-5  0x000000000048683a in ast_spawn_extension (c=0x14ece90) at pbx.c:2283
ASTERISK-6 __ast_pbx_run (c=0x14ece90) at pbx.c:2373
ASTERISK-7 0x0000000000488139 in pbx_thread (data=0x7469726f6972500a) at pbx.c:2599
ASTERISK-8 0x00000000004b5b1c in dummy_start (data=<value optimized out>) at utils.c:856
ASTERISK-9 0x00007f03312abfd7 in start_thread () from /lib/libpthread.so.0
ASTERISK-10 0x00007f03309271fd in clone () from /lib/libc.so.6
ASTERISK-11 0x0000000000000000 in ?? ()

By: John Hass (john8675309) 2010-01-01 09:37:21.000-0600

Lastly here is what happens on 1.4 trunk with the only have the call problem.

onnected to Asterisk SVN-branch-1.4-r236981 currently running on uncensored4 (pid = 4086)
uncensored4*CLI> core set verbose 3
Verbosity was 0 and is now 3
 == Parsing '/etc/asterisk/manager.conf': Found
 == Manager 'sm50' logged on from 127.0.0.1
[Jan  1 09:36:37] ERROR[4124]: utils.c:966 ast_carefulwrite: write() returned error: Broken pipe
[Jan  1 09:36:37] ERROR[4124]: utils.c:966 ast_carefulwrite: write() returned error: Broken pipe
   -- Executing [998@default:1] Konference("Local/998@default-258a,2", "1234|q") in new stack

By: John Hass (john8675309) 2010-01-03 10:01:03.000-0600

it appears that this issue started when applying patch 200991, I started from the working 1.4.25.1 and and ran svn -r for each channel patch level, I tested the attached script and dialplan, when I applied 200911 it caused the segfault.  I have attached the unoptimized backtrace to this post.

By: Leif Madsen (lmadsen) 2010-01-04 09:38:55.000-0600

Thank you for the thorough bug report! I'll mark this as Acknowledged now. This type of reporting helps a GREAT DEAL in tracking down and resolving issues. Thanks again.

By: Paul Albrecht (palbrecht) 2010-01-05 11:45:20.000-0600

I think I found the problem or at least part of the problem. The application that plays mp3 streams wasn't updated when the frame_list field was added to the frame structure. As a result, it seems the field contains random data and segfaults on the first frame write. I changed the code to clear the frame structure before use and the problem went away. What do you think? Make sense? Now I'm getting the log error for exceptionally long frames. Does the frame need to be adjusted or broken up like the other applications that were changed with 200991?

By: Digium Subversion (svnbot) 2010-01-06 09:18:24.000-0600

Repository: asterisk
Revision: 238009

U   branches/1.4/apps/app_mp3.c

------------------------------------------------------------------------
r238009 | russell | 2010-01-06 09:18:23 -0600 (Wed, 06 Jan 2010) | 7 lines

Resolve a crash due to an ast_frame not being fully initialized.

(closes issue ASTERISK-15385)
Reported by: john8675309

(closes SWP-615)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=238009

By: Digium Subversion (svnbot) 2010-01-06 09:19:10.000-0600

Repository: asterisk
Revision: 238010

_U  trunk/
U   trunk/apps/app_mp3.c

------------------------------------------------------------------------
r238010 | russell | 2010-01-06 09:19:10 -0600 (Wed, 06 Jan 2010) | 14 lines

Merged revisions 238009 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r238009 | russell | 2010-01-06 09:18:22 -0600 (Wed, 06 Jan 2010) | 7 lines
 
 Resolve a crash due to an ast_frame not being fully initialized.
 
 (closes issue ASTERISK-15385)
 Reported by: john8675309
 
 (closes SWP-615)
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=238010

By: Digium Subversion (svnbot) 2010-01-06 09:20:02.000-0600

Repository: asterisk
Revision: 238011

_U  branches/1.6.0/
U   branches/1.6.0/apps/app_mp3.c

------------------------------------------------------------------------
r238011 | russell | 2010-01-06 09:20:02 -0600 (Wed, 06 Jan 2010) | 21 lines

Merged revisions 238010 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r238010 | russell | 2010-01-06 09:19:10 -0600 (Wed, 06 Jan 2010) | 14 lines
 
 Merged revisions 238009 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r238009 | russell | 2010-01-06 09:18:22 -0600 (Wed, 06 Jan 2010) | 7 lines
   
   Resolve a crash due to an ast_frame not being fully initialized.
   
   (closes issue ASTERISK-15385)
   Reported by: john8675309
   
   (closes SWP-615)
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=238011

By: Digium Subversion (svnbot) 2010-01-06 09:21:30.000-0600

Repository: asterisk
Revision: 238012

_U  branches/1.6.1/
U   branches/1.6.1/apps/app_mp3.c

------------------------------------------------------------------------
r238012 | russell | 2010-01-06 09:21:29 -0600 (Wed, 06 Jan 2010) | 21 lines

Merged revisions 238010 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r238010 | russell | 2010-01-06 09:19:10 -0600 (Wed, 06 Jan 2010) | 14 lines
 
 Merged revisions 238009 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r238009 | russell | 2010-01-06 09:18:22 -0600 (Wed, 06 Jan 2010) | 7 lines
   
   Resolve a crash due to an ast_frame not being fully initialized.
   
   (closes issue ASTERISK-15385)
   Reported by: john8675309
   
   (closes SWP-615)
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=238012

By: Digium Subversion (svnbot) 2010-01-06 09:22:42.000-0600

Repository: asterisk
Revision: 238013

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_mp3.c

------------------------------------------------------------------------
r238013 | russell | 2010-01-06 09:22:42 -0600 (Wed, 06 Jan 2010) | 21 lines

Merged revisions 238010 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r238010 | russell | 2010-01-06 09:19:10 -0600 (Wed, 06 Jan 2010) | 14 lines
 
 Merged revisions 238009 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r238009 | russell | 2010-01-06 09:18:22 -0600 (Wed, 06 Jan 2010) | 7 lines
   
   Resolve a crash due to an ast_frame not being fully initialized.
   
   (closes issue ASTERISK-15385)
   Reported by: john8675309
   
   (closes SWP-615)
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=238013