Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Expect "timeout" not getting triggered (Random issue)

27 views
Skip to first unread message

svina...@gmail.com

unread,
May 19, 2013, 1:58:41 PM5/19/13
to
Hi

I am using expect version 5.40 (/bin/expect -version ) and I am encountering a very random issue (reproducibility 1 in 20).

Issue is: timeout is not getting triggered when flood of messages is received.

Code snippet as follows

======================================
exp_internal 1
set TimeoutTick 0
set timeout 1
send " \r"
expect {
"(none)" {
**** do something ****
exp_continue
}
-re "Bad Magic Number\r\nar7240>" {
**** do something ****
return
}
-re "ar7240>" {
**** do something ****
exp_continue }
-re "\n~ # " {
**** do something ****
return
}
timeout {
puts "In time-out"
if { $TimeoutTick < $TimeOutLimit} {
**** take action for couple of retrie****
exp_continue
} else {
puts "Giving up"
exp_internal 0

}
}
============================================

In order to debug the issue, I set "exp_internal 1" in the function and clear the debug log "exp_internal 0" when it exits.

Log when issue is observed as follows
******************************
kernel: "ar7240>"? no^M
kernel: "\n~ # "? no^M
kernel: expect: timed out^M
kernel: In time-out^M
kernel: send: sending " \r" to { exp4 }^M
kernel: expect: continuing expect^M
kernel: ^M
kernel: expect: does " Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s\r\n
................
.............
[ NOTE ] around 200 - 300 Kbs of data
............
...............

kernel: "Bad Magic Number\r\nar7240>"? no^M
kernel: "ar7240>"? no^M
kernel: "\n~ # "? no^M
[NOTE ] <------TIMEOUT not getting triggered?------------------->
kernel: expect: set expect_out(spawn_id) "exp4"^M
kernel: expect: set expect_out(buffer) "Mb/s\r\n
................
.............
[ NOTE ] around 200 - 300 Kbs of data
............


******************************

As this issue is very random, seen when logs of data is in expect buffer , the question is, why timeout not getting triggered (incorporated in NOTES section between logs?

Any suggestion or help will be greatly appreciated.
Any *Conditions* for time out to get triggered?

Thanks in advance.

Vinayak

svina...@gmail.com

unread,
May 19, 2013, 2:18:41 PM5/19/13
to
I forgot to mention that , when this issue is observed, expect freezes / hangs.
0 new messages