[Voiceglue] infinite loop thread?

Quentin Bellenoue quentin.bellenoue at ovh.net
Tue Jun 9 13:17:33 UTC 2009


I have fixed an infinite loop into OpenVXI parser, when a VoiceXML 
application is recursive. Perhaps is your case.

    * This is the file to patch openvxi-3.4+vglue/src/VXI/VXI.cpp with this:

--- VXI.cpp    2008-12-15 21:04:18.000000000 +0100
+++ VXI.cpp    2009-06-09 15:14:33.000000000 +0200
@@ -59,6 +59,7 @@ static const wchar_t * const GENERIC_DEF
 const int DEFAULT_MAX_EXE_STACK_DEPTH = 50;
 const int DEFAULT_MAX_EVENT_RETHROWS  = 6;
 const int DEFAULT_MAX_EVENT_COUNT     = 12;
+const int DEFAULT_RUN_INNER_LOOP_LIMIT = 30;
 
 // 
------*---------*---------*---------*---------*---------*---------*---------
 static vxistring toString(const VXIString * s)
@@ -1332,8 +1333,11 @@ void VXI::RunInnerLoop()
   bool unprocessedAnswer = false;
 
   // Run the dialog loop
+  int count = 0;
   while (1) {
     if (stopRequested) throw VXIException::StopRequest();
+    if ( count > DEFAULT_RUN_INNER_LOOP_LIMIT)
+        throw VXIException::InterpreterEvent( EV_ERROR_LOOP_COUNT);
 
     try {
       try {
@@ -1452,6 +1456,7 @@ void VXI::RunInnerLoop()
       exe->currentFormItem = e.element;
       unprocessedAnswer = true;
     }
+    count++;
   } // while (1)
 
   log->LogDiagnostic(2, L"VXI::RunInnerLoop - done");

Yours.

--
Quentin B.

James Green wrote:
> Asterisk 1.6.1.0 Voiceglue 0.10 Ubuntu 9.04
>  
> Managed to send a little over 400 of 1,000 test messages.
>  
> Dynlog capture: http://pastebin.com/m5e37930f
>  
> Voiceglue is hung consuming 100% CPU, strace on the pid shows:
>  
> Process 8560 attached - interrupt to quit
> futex(0x7fef0dffb9e0, FUTEX_WAIT, 16375, NULL
>  
> strace with -f:
>  
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> [pid 16375] read(12, ""..., 1024)       = 0
> **** [Spews rapidily, infinitely] *****
> ^CProcess 8560 detached
> Process 16255 detached
> Process 16256 detached
> Process 16257 detached
> Process 16258 detached
> Process 16304 detached
> Process 16305 detached
> Process 16306 detached
> Process 16307 detached
> Process 16308 detached
> Process 16311 detached
> Process 16337 detached
> Process 16347 detached
> Process 16375 detached
> Process 16376 detached
> Process 16377 detached
> Process 16378 detached
> Looking in /proc/8560/task/16375/io:
>  
> rchar: 30630
> wchar: 93326
> syscr: 84109313979
> syscw: 161
> read_bytes: 0
> write_bytes: 20480
> cancelled_write_bytes: 0
> syscr is going up rapidly. vmstat shows:
>  
> jamesg@$ <mailto:jamesg@$> vmstat 1
> procs -----------memory---------- ---swap-- -----io---- -system-- 
> ----cpu----
>  r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us 
> sy id wa
>  2  0 195664  11776   6964 225136    0    0    11    24   22    0  6  
> 7 87  0
>  2  0 195664  11760   6964 225160    0    0     0     0 1574  234 15 
> 41 44  0
>  1  0 195664  11760   6980 225160    0    0     0   168 1585  267 19 
> 37 45  0
>  1  0 195664  11760   6996 225164    0    0     0    64 1602  356 21 
> 38 41  0
>  3  0 195664  11760   6996 225164    0    0     0     0 1582  234 18 
> 37 44  0
>  1  0 195664  11556   7004 225156    0    0     4    32 1601  325 21 
> 39 41  0
>  1  0 195664  11504   7004 225168    0    0     0     0 1578  259 18 
> 37 45  0
> Not sure what else to provide in debugging to be honest. We have a 
> full asterisk trace too, but logs and an strace (which is well over 2Gb).
>  
> James
>  
>
> No virus found in this outgoing message.
> Checked by AVG - www.avg.com
> Version: 8.5.339 / Virus Database: 270.12.58/2164 - Release Date: 
> 06/09/09 05:53:00
>
> ------------------------------------------------------------------------
>
>
> No virus found in this outgoing message.
> Checked by AVG - www.avg.com 
> Version: 8.5.339 / Virus Database: 270.12.59/2165 - Release Date: 06/09/09 05:53:00
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Voiceglue mailing list
> Voiceglue at voiceglue.org
> http://www.voiceglue.org/mailman/listinfo/voiceglue
>   



More information about the Voiceglue mailing list