[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SEGMENTATION FAULT



Look at your trace file, you must have got a incomplete nam trace file
with the last line lacking a '}' to close the brace there. Then
get_trace_line in nam will fail there. I think I've checked in fixes to
make nam print out error messages instead of crash in such cases. 

If you fix your script and ns produces full nam trace, it'll be fine. (I
guess the seg fault is due to your connecting a CBR to a Agent/Null.
Also, nam snapshot changes everyday. If you found something broken, maybe
you want to update your nam, or let me know...)

- Haobo

On Thu, 23 Jul 1998, Harlisya Harun wrote:

> 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
>