[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SEGMENTATION FAULT
Hi,
We have installed the latest version of NSALLINONE and the current NAM snapshot(nam version 1.0a5)....I have run this tcl script, it works well and give the graphics:
set ns [new Simulator]
set nf [open out.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam out.nam &
exit 0
}
set n0 [$ns node]
set n1 [$ns node]
$ns duplex-link $n0 $n1 1Mb 10ms DropTail
$ns at 5.0 "finish"
$ns run
But, when I add few other lines to the script, I've received this error message: "segmentation fault".
The script:
set ns [new Simulator]
set nf [open out.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam out.nam &
exit 0
}
set n0 [$ns node]
set n1 [$ns node]
$ns duplex-link $n0 $n1 1Mb 10ms DropTail
set cbr0 [new Agent/CBR]
$ns attach-agent $n0 $cbr0
$cbr0 set packetSize_ 500
$cbr0 set interval_ 0.005
set null0 [new Agent/Null]
$ns attach-agent $n1 $null0
$ns connect $cbr0 $null0
$ns at 0.5 "$cbr0 start"
$ns at 4.5 "$cbr0 stop"
$ns at 5.0 "finish"
$ns run
I manage to use NAM OPEN TRACE FILE WINDOW to detect the error, which give me this error messages:
> Failed to start animator:
class Animator: constructor failed: unmatched open brace in list
unmatched open brace in list
while executing
"foreach item $traceevent {
if { $next == 1 } {
return $item
}
if { $item == $tag } {
set next 1
}
}"
(procedure "get_trace_item" line 3)
invoked from within
"get_trace_item "-t" $line"
(procedure "_o6" line 8)
(Animator infer-network-model line 8)
invoked from within
"$self infer-network-model $tracefile"
(procedure "_o6" line 58)
(Animator init line 58)
invoked from within
"Animator create _o6 /home/gordon/harlisya/latihan
/example1b.tcl p="
invoked from within
"catch "$className create $o $args" msg"
(procedure "new" line 3)
invoked from within
"new Animator $tracefile $args"
Thank you.
??????
harlisya