[asterisk-bugs] [Asterisk 0018430]: [patch] Segfault when ExternalIVR() app. immediately sends S command due to race condition

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Jan 3 14:09:31 UTC 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18430 
====================================================================== 
Reported By:                stevebrandli
Assigned To:                thedavidfactor
====================================================================== 
Project:                    Asterisk
Issue ID:                   18430
Category:                   Applications/app_externalivr
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.8.0 
JIRA:                       SWP-2686 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-12-06 21:01 CST
Last Modified:              2011-01-03 08:09 CST
====================================================================== 
Summary:                    [patch] Segfault when ExternalIVR() app. immediately
sends S command due to race condition
Description: 
Segfault occurs if the ExternalIVR() application sends an S command faster
than the sound generator can setup and "play silence."  The segfault occurs
because the code believes it must send a T event but there are no sound
files current playing.

Entire extensions.conf:
[internal]
70,1,ExternalIVR(/var/lib/asterisk/agi-bin/fndatyivr.py)
70,n,Hangup()

Entire python script referenced above:
#!/usr/bin/python
import sys
import time
#time.sleep(1)
sys.stdout.write("S,/etc/asterisk/sounds/fndaty/WaitBrandli\n")
sys.stdout.flush()
time.sleep(10)

Just dial extension 70.  Notice the if the time.sleep(1) line in the
python script is uncommented, there is no problem.  I assume it is possible
that other setups will have trouble reproducing because application
execution takes longer.

Please consider relating issue https://issues.asterisk.org/view.php?id=17335.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0017335 ExternalIVR 'S' command sometimes resul...
====================================================================== 

---------------------------------------------------------------------- 
 (0130089) svnbot (reporter) - 2011-01-03 08:09
 https://issues.asterisk.org/view.php?id=18430#c130089 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 300121

U   trunk/apps/app_externalivr.c

------------------------------------------------------------------------
r300121 | diruggles | 2011-01-03 08:09:30 -0600 (Mon, 03 Jan 2011) | 13
lines

initialize playing_silence in struct initialization

playing_silence was not initialized with the struct
was initialized, it was being set after the fact
which caused problems if something that relied on
playing_silence being set was called too quickly

(closes issue https://issues.asterisk.org/view.php?id=18430)
Reported by: stevebrandli
Patches: 
      externalivr.patch uploaded by thedavidfactor (license 903)
Tested by: thedavidfactor, stevebrandli

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-03 08:09 svnbot         Checkin                                      
2011-01-03 08:09 svnbot         Note Added: 0130089                          
======================================================================




More information about the asterisk-bugs mailing list