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

[ns] a bug of ns-2.1b7?



Hi ns people,

I have met a few "bus error"s when I run some examples
on ns-2.1b7. The most recent one is the following example:


____________________________________________________________

#Create a simulator object
set ns [new Simulator]

#Open the nam trace file
set nf [open out.nam w]
$ns namtrace-all $nf

#Define a 'finish' procedure
proc finish {} {
        global ns nf
        $ns flush-trace
	#Close the trace file
        close $nf
	#Execute nam on the trace file
        exec nam out.nam &
        exit 0
}

#Create two nodes
set n0 [$ns node]
set n1 [$ns node]

#Create a duplex link between the nodes
$ns duplex-link $n0 $n1 1Mb 10ms DropTail

#Create a UDP agent and attach it to node n0
set udp0 [new Agent/UDP]
$ns attach-agent $n0 $udp0

#Create a CBR traffic source and attach it to udp0
set par0 [new Application/Traffic/Pareto]
$par0 set packetSize_ 210
$par0 set burst_time_ 0.005
$par0 set idle_time_ 0.005
$par0 set rate_ 200k
$par0 set shape_ 1.5
$par0 attach-agent $udp0

#Create a Null agent (a traffic sink) and attach it to node n1
set null0 [new Agent/Null]
$ns attach-agent $n1 $null0

#Connect the traffic source with the traffic sink
$ns connect $udp0 $null0  

#Schedule events for the CBR agent
$ns at 0.5 "$par0 start"
$ns at 4.5 "$par0 stop"
#Call the finish procedure after 5 seconds of simulation time
$ns at 5.0 "finish"

#Run the simulation
$ns run
_______________________________________________________________




I tried to use GDB to trace the error. I have got the following
information:


=================================================================
warning: Lowest section in /usr/lib/libintl.so.1 is .hash at 0x74

Program received signal SIGBUS, Bus error.
0xa3264 in RNGImplementation::next ()
=================================================================


Some of the upper levels of the function calls are:


===========================================================
#0  0xa3264 in RNGImplementation::next ()
(gdb) up
#1  0xa32d4 in RNGImplementation::next_double ()
(gdb) up
#2  0xb052c in POO_Traffic::next_interval ()
(gdb) up
#3  0xafc20 in TrafficGenerator::start ()
===========================================================


I would like to provide three important points:

1. The whole example runs ok in ns-2.1b5.

2. If I comment out the code part for "creating the CBR 
traffic source and attach it to udp0", then no error accurs.

3. My operating system is SunOS 5.7.

Does this indicate a bug of ns-2.1b7 related to random 
number generating? I could not find the answer in the FAQ, 
ns-problems page, and manual. Can anyone help me to solve 
this problem?

Thanks in advance.

Ming Feng