"Interpreting too long." message

Version 1

    Subject: RE: "Interpreting too long." message
    Replied by: Yaw-Ming Chen on 11-11-2010 04:38:58 PM
    1. Script will always abort when error occurs
     
    2. Why is has something to do with timer ?
        What is you AniListFile looks like ?
        are you trying to screen some numbers from file ?
     
    The following is an example that if ani is on the list script will block the call.
    is this something similar what you are trying to do ?
     

    proc readDataFile { fname } {
        global BlockArray

        puts "TCL:Enter=readDataFile"
        if [catch {set fd [open $fname] } errmsg] {
            puts "TCL: Unable to open blocking list file: $fname for reading\n$errmsg"
            return -1
        }

        set noDataRead 1
        while {[gets $fd string] != -1} {
            set blockNum  [lindex $string 0]

            if { [regexp {^#} $blockNum] } {
                puts "TCL:Line is a comment"
                continue
            }

            if { ![regexp {^[0-9]*$} $blockNum] } {
                puts "TCL: Invalid number configured ignoring this entry"
                continue
            } else {

                set BlockArray($blockNum) $blockNum
                set noDataRead 0
            }
        }    ;#end of while
        # Process any errors that occurred during the read
        if ![eof $fd] {
            puts "Error occurred while reading pilot file"
            return -1
        }

        close $fd

        if { $noDataRead } {
            return -1
            puts "TCL:WARNING: No number readed from blocking lict  file, please check the Content file, might be corrupted"
        }
    }
     
    data file:
     
    7771001
    8882002
    9993003
    This document was generated from CDN thread

    Created by: TAKAAKI HOZUMI on 11-11-2010 12:40:40 PM
    My script got the error message:
    ----------
    Nov  8 16:19:12.875: //3583//AFW_:/AFW_FSM_Drive: Tcl_Eval to drive FSM inside Tcl modulespace. code=1 code=ERROR
    Nov  8 16:19:12.875: TCL script failure
            Result:
                             Interpreting too long. Infinite loop?
    Nov  8 16:19:12.875:    TCL script failure errorInfo:
                            Interpreting too long. Infinite loop?
        while executing
    "scan $line {%[^,],%[^,]} tmp1 tmp2"
        (procedure "act_listedAniCallSearch" line 13)
        invoked from within
    "act_listedAniCallSearch"
        (procedure "act_Setup" line 35)
        invoked from within
    "act_Setup"
    ----------

    My code:
    ----------
    set fileID [open $aniListFile]
    while {! [eof $fileID]} {
        set line [gets $fileID]
        if { [string match $Ani* $line] } {
            scan $line {%[^,],%[^,]} tmp1 tmp2
            break
        }
        incr x
        if { $x > $aniListMaxReadLine } { puts "Too many List entry !!"; break }
    }
    close $fileID
    ----------

    Question:
    1) When this occurs, the script has abort running. What step for not abort script ?

    2) "Interpreting too long" occurs or what conditions. Is it possible to tuning the timer ?

    Thanks,

    Subject: RE: "Interpreting too long." message
    Replied by: TAKAAKI HOZUMI on 12-11-2010 09:11:48 AM
    Thank you for your reply.

    1. ok, Thanks.

    2.
    Thank you very match for your great code!
    My AniList is caller number list on the flash.
    The list is 10000 numbers.
    We test with 2801 router:
    ----------
    7000 numbers: got the error message "Interpreting too long"
    6000 numbers: no problem 3 days ago. But got the error message "Interpreting too long" today.
    3000 numbers: no problem 3 days ago. But got the error message "Interpreting too long" today.
    2000 numbers: no problem 3 days ago and today.
    * code not change between 3 days ago and today.
    ----------
    I want to know the maximum number of rows successfully processed a script.
    I got the error message "Interpreting too long" is about 1 sec.
    I want to tune the time until the script error(if possible. For example 1 to 3 sec).

    Thanks,

    Subject: RE: "Interpreting too long." message
    Replied by: Yaw-Ming Chen on 15-11-2010 10:03:38 PM
    I increased my file to more than 10000 lines and the match is in 10000+ lines as well and I don't see any issue.
     
    Thanks !

    Subject: RE: "Interpreting too long." message
    Replied by: TAKAAKI HOZUMI on 16-11-2010 12:54:50 PM
    Thank you for your reply.

    My test tcl script got same error message("Interpreting too long").
    My test tcl script: read 3900 lines is good. read 4000 lines got error message.

    My Procedure:
     - copy http://x.x.x.x/cdn-temp2.tcl flash:
     - copy http://x.x.x.x/newList flash:
     - debug voip application script
     - debug voip application tclcommands
     - conf t
       application
        service cdn flash:cdn-temp2.tcl
     - call application voice load cdn
     I got error message.

    Could you run the attaced program ?

    Attach: My tcl script(cdn-temp2.tcl), My list(newList)

    Thanks,

    Subject: RE: "Interpreting too long." message
    Replied by: Yaw-Ming Chen on 17-11-2010 07:55:10 PM
    My suggestion is that if you just need to match a number then simplify the data file. Reduce the number of element per line.
     
    Thank !