Summary:ASTERISK-00289: voicemail2 segfaults on digit playback
Reporter:gadams666 (gadams666)Labels:
Date Opened:2003-09-19 09:56:21Date Closed:2004-09-25 02:46:18
Versions:Frequency of
Environment:Attachments:( 0) app_voicemail2__bugfix_20030919.diff
Description:From CVS build 19-Sep-2003 08:00 EDT, when user attempts to playback message, asterisk segfaults wehn attmepting to playback digits.

Just before the first digit is played, asterisk segfaults. Unable to provide debug trace as channels are in use.
Comments:By: gadams666 (gadams666) 2003-09-19 10:05:11

Was able to get debug:

   -- Executing VoiceMailMain2("SIP/4001-e1e5", "4001") in new stack
   -- Playing 'vm-password'
   -- Playing 'vm-youhave'
   -- Playing 'digits/2'
   -- Playing 'vm-INBOX'
   -- Playing 'vm-messages'
   -- Playing 'vm-onefor'
   -- Playing 'vm-INBOX'
   -- Playing 'vm-messages'
   -- Playing 'vm-first'
   -- Playing 'vm-message'
 == Parsing '/var/spool/asterisk/voicemail/sip/4001/INBOX/msg0000.txt': Found
Segmentation fault (core dumped)
Ouch ... error while writing audio data: : Broken pipe
Ouch ... error while writing audio data: : Broken pipe
Ouch ... error while writing audio data: : Broken pipe

By: Brian West (bkw918) 2003-09-19 10:06:08

are you running asterisk at root?  If not then check permissions.

By: gadams666 (gadams666) 2003-09-19 10:16:05

Yes, it's running as root. Was working fine prior to today's CVS update. Others experiencing the same problem.

By: Brian West (bkw918) 2003-09-19 11:11:08

(gdb) bt
#0  ast_tzset_basic (name=0x50 <Address 0x50 out of bounds>) at localtime.c:923
#1  0x080a7ae2 in ast_localtime (timep=0x812bab8, p_tm=0x4974485c, zone=0x50 <Address 0x50 out of bounds>) at localtime.c:955
#2  0x08061455 in ast_say_date_with_format (chan=0x812a2b8, time=1063986419, ints=0x41ffa39f "0123456789#*",
   lang=0x812a308 "en", format=0xa0 <Address 0xa0 out of bounds>, timezone=0x50 <Address 0x50 out of bounds>) at say.c:257
#3  0x41ff8b43 in play_message_datetime (chan=0x812a2b8, vmu=0x497457ac, vms=0x812bab8) at app_voicemail2.c:1960
#4  0x41ff56de in play_message (chan=0x812a2b8, vmu=0x812bab8, vms=0x49745a3c, msg=0) at app_voicemail2.c:1986
ASTERISK-1  0x41fefdb4 in vm_execmain (chan=0x812a2b8, data=0x49745a3c) at app_voicemail2.c:2373
ASTERISK-2  0x08062f29 in pbx_exec (c=0x812a2b8, app=0x81229b8, data=0x4974674c, newstack=1) at pbx.c:396
ASTERISK-3  0x0806a230 in pbx_extension_helper (c=0x49745a3c, context=0x812a40c "default", exten=0x812a500 "300", priority=3,
   callerid=0x80de868 "\"Brian West\" <1000>", action=80) at pbx.c:1150
ASTERISK-4  0x08064e1c in ast_pbx_run (c=0x50) at pbx.c:1634
ASTERISK-5  0x0806a901 in pbx_thread (data=0x812bab8) at pbx.c:1855
ASTERISK-6 0x40024941 in pthread_start_thread () from /lib/i686/libpthread.so.0

By: Brian West (bkw918) 2003-09-19 12:54:48

#0  0x4207931a in strcmp () from /lib/i686/libc.so.6
#1  0x080a7c2c in localsub (timep=0x499448b0, offset=1063992576, tmp=0x4994485c, zone=0x0) at localtime.c:985
#2  0x080a7b09 in ast_localtime (timep=0x3f6b3d00, p_tm=0x4994485c, zone=0x0) at localtime.c:1044
#3  0x08061455 in ast_say_date_with_format (chan=0x8100a30, time=1063992657, ints=0x41ffa3bf "0123456789#*",
   lang=0x8100a80 "en", format=0x41ffa240 "'vm-received' q 'digits/at' IMp", timezone=0x0) at say.c:257
#4  0x41ff8b4d in play_message_datetime (chan=0x8100a30, vmu=0x499457ac, vms=0x3f6b3d00) at app_voicemail2.c:1958
ASTERISK-1  0x41ff56de in play_message (chan=0x8100a30, vmu=0x3f6b3d00, vms=0x49945a3c, msg=0) at app_voicemail2.c:1986
ASTERISK-2  0x41fefdb4 in vm_execmain (chan=0x8100a30, data=0x49945a3c) at app_voicemail2.c:2373
ASTERISK-3  0x08062f29 in pbx_exec (c=0x8100a30, app=0x8122968, data=0x4994674c, newstack=1) at pbx.c:396
ASTERISK-4  0x0806a230 in pbx_extension_helper (c=0x49945a3c, context=0x8100b84 "default", exten=0x8100c78 "300", priority=3,
   callerid=0x80d6138 "\"Brian West\" <1000>", action=0) at pbx.c:1150
ASTERISK-5  0x08064e1c in ast_pbx_run (c=0x0) at pbx.c:1634
ASTERISK-6 0x0806a901 in pbx_thread (data=0x3f6b3d00) at pbx.c:1855
ASTERISK-7 0x40024941 in pthread_start_thread () from /lib/i686/libpthread.so.0

By: Tilghman Lesher (tilghman) 2003-09-19 14:54:41

Found both bugs.

a) Passed first character instead of the address of the string in app_voicemail2.
b) Didn't check for zone==null in stdtime/localtime.c: localsub().

Remember to beat me over the head the next time you see me for not testing my patches.

By: Brian West (bkw918) 2003-09-19 15:06:13

That fixed it! :P

By: John Todd (jtodd) 2003-09-19 15:06:54

Tested with a CVS update as of 12:25 PDT and seems to work without crashing on tz-modified envelope information.

By: oliver (oliver) 2003-09-20 08:12:37

Just to let you know that the same problem popped up here as well, with yesterday's CVS.  It still seems to be present in the current CVS-version, however.  I'm assuming the fix didn't make it into CVS yet and needs testing.  I'll apply the patch here and will get back to you, should I find any problems.

By: oliver (oliver) 2003-09-20 08:21:08

FYI: First tests show the segfault is indeed fixed by this patch.  Didn't find any problems with it so far.

By: Mark Spencer (markster) 2003-09-21 14:46:39

Fixed in CVS