« Back to TCL-API

RE: Timer causing a crash

Combination View Flat View Tree View
Threads [ Previous | Next ]
Timer causing a crash
timer crash cpu exception ios 15.2.2
Answer
3/21/12 12:52 PM
Hello,
 
We have two Cisco machines:
- 3825/IOS 12.4(15)T9
- 3945E/IOS 15.2(2)T 
 
I have a tcl script which contains a timer. This script works on the 3825, but as soon as I configure the tcl script as a service under application the machine crashes. Using the following commands:
config t
application
service MyScriptWithATimer
 
This is the error:  15:40:07 CET Tue Mar 13 2012: Unexpected exception to CPU: vector D, PC = 0x2BAAFB5.
 
When I comment the timer command: timer start named_timer $poll_interval pollwait, it does not crash and the script is loaded. But the timer should start when the application is loaded and an instance is created. This is pretty much the main idea of the script. It does something when the timer expires. 
 
 
proc start_poll_timer { } {
global poll_interval
timer start named_timer $poll_interval pollwait
fsm setstate INITIAL
}
 
 
#State machine here
 
fsm define FSM INITIAL
start_poll_timer
 
Is the hardware faulty or is there another reason?
 
Thanks,
 
Grant
 

Hard to tell without complete script. Is it possible to post it ?
Please indicate the IOS version too.

This is not the original script, since I'm not allowed to post our own source code. Instead I made a new script which uses a timer to do something.

I've tested on both machines:

- 3825/IOS 12.4(15)T9 --> This one executed the script without any problems.
- 3945E/IOS 15.2(2)T ---> This one crashed again.

proc init { } {
puts "Loading done..."
}

proc do_something { } {
puts "I'm now doing something...."
start_poll_timer
}

proc disconnect { } {
call close
}

proc start_poll_timer { } {
timer start named_timer 5 pollwait
fsm setstate INITIAL
}


init

#-----------------------------------------------------------#
# STATE MACHINE #
#-----------------------------------------------------------#
set FSM(INITIAL,ev_named_timer) "do_something same_state"
set FSM(any_state,ev_disconnected) "disconnect same_state"
set FSM(any_state,ev_disconnect_done) "disconnect same_state"
fsm define FSM INITIAL
start_poll_timer

Hi Grant,

As per your code TCL script will keep on calling start_poll_timer procedure for every 5 sec, it is in loop.

Thanks,
Raghavendra

RE: Timer causing a crash
Answer
3/14/12 10:47 AM as a reply to Raghavendra Gutty Veeranagappa.
Hello,

Yes, that's the purpose of the script. What the original script does is poll for a call from a web service each X seconds to place a call. This works just fine on our 3825 machine.

I now have another problem. The 3945E keeps crashing on boot, because each time it boots it tries to load the script.

Does anyone know how I can fix this? Erase the startup config or something?

Thanks,

Grant

Never mind, I managed to fix it using the rommon mode and confreg 0x2142 to ignore the NVRAM. After it booted up with a clean config I deleted the tcl script from the flash and rebooted back with confreg 0x102. Now my initial config is back but the device doesnt crash anymore since it cant find the file on the flash

Don't know what exactly you are trying to do but just like to mention that if the task is not call processing related you can utilize Cisco EEM Tcl script.
Such as executing some CLI duing boot up, executing CLI every X seconds by using watch dog timer ....

It is call processing related. This tcl code was just an example of the timer.

I've already opened a TAC case about this since we obtained the 3945E through the Cisco Demo Loan Program.

Thanks for the info Yaw-Ming. Cisco EEM is going to come in handy as I already have some application in mind which must utilize the CLI.

This is a bug in the IOS. The TAC team pointed it is the following bug: CSCts69887 %SYS-3-MGDTIMER: and %ALIGN-3-TRACE At Bootup Due To TCL Files