Error code -11

26 views
Skip to first unread message

Nav

unread,
Apr 15, 2009, 3:39:31 AM4/15/09
to ns-3-users
Hi,

The following is the script I am using to test a new protocol. I have
placed a small part of this code under markers (///). The code
compiles and starts to execute. But If i set the value of
echoClient.SetAttribute ("MaxPackets", UintegerValue (9)); or any
values above 9, i get an error message Command ['/home/Navin/Documents/
ns-3.3/build/debug/scratch/wifi-olsr'] exited with code -11 . For
Values below 9 the scripts sucessfully executes.

Does anyone know what this error is? Can someone help me with this? I
have pasted my script and full ouput below.

int
main (int argc, char *argv[])
{
LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_ALL);
LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_ALL);
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
uint32_t nMRouters = 15;
CommandLine cmd;
cmd.AddValue ("nMRouters", "Number of mesh router devices",
nMRouters);
cmd.Parse (argc,argv);

NodeContainer meshNodes;
meshNodes.Create (nMRouters);
InternetStackHelper stack;
stack.Install (meshNodes);

YansWifiChannelHelper channel;
channel.AddPropagationLoss
("ns3::LogDistancePropagationLossModel","Exponent", DoubleValue(2.5));
channel.SetPropagationDelay
("ns3::ConstantSpeedPropagationDelayModel","Speed", DoubleValue(3e
+08));
YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
phy.SetChannel (channel.Create ());
WifiHelper wifi = WifiHelper::Default ();
wifi.SetRemoteStationManager
("ns3::ConstantRateWifiManager","DataMode",StringValue
("wifia-6mbs"));
wifi.SetMac ("ns3::AdhocWifiMac");
NetDeviceContainer wifiDevices = wifi.Install (phy, meshNodes);

MobilityHelper mobility;
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
"MinX", DoubleValue (0.0),
"MinY", DoubleValue (0.0),
"DeltaX", DoubleValue (250.0),
"DeltaY", DoubleValue (100.0),
"GridWidth", UintegerValue (5),
"LayoutType", StringValue ("RowFirst"));
mobility.SetMobilityModel ("ns3::StaticMobilityModel");
mobility.Install (meshNodes);

Ipv4AddressHelper address;
address.SetBase ("192.168.0.0", "255.255.255.0");
Ipv4InterfaceContainer wifiInterface;
wifiInterface=address.Assign(wifiDevices);

UdpEchoServerHelper echoServer (9);
ApplicationContainer serverApps = echoServer.Install (meshNodes.Get
(14));
serverApps.Start (Seconds (1.0));
serverApps.Stop (Seconds (500.0));

//////////////////////////////////////////////////////////////////////////////////////////

UdpEchoClientHelper echoClient (wifiInterface.GetAddress
(14), 9);
echoClient.SetAttribute ("MaxPackets", UintegerValue (8));
echoClient.SetAttribute ("Interval", TimeValue (Seconds (5.)));
echoClient.SetAttribute ("PacketSize", UintegerValue (1024));
//////////////////////////////////////////////////////////////////////////////////////
UdpEchoClientHelper echoClient1 (wifiInterface.GetAddress
(14), 9);
echoClient1.SetAttribute ("MaxPackets", UintegerValue (1));
echoClient1.SetAttribute ("Interval", TimeValue (Seconds (20.)));
echoClient1.SetAttribute ("PacketSize", UintegerValue (1024));

ApplicationContainer clientApps = echoClient.Install (meshNodes.Get
(2));

ApplicationContainer clientApps1 = echoClient1.Install
(meshNodes.Get (1));
ApplicationContainer clientApps2 = echoClient1.Install
(meshNodes.Get (0));
ApplicationContainer clientApps3 = echoClient1.Install
(meshNodes.Get (3));
ApplicationContainer clientApps4 = echoClient1.Install
(meshNodes.Get (4));

clientApps.Start (Seconds (200.0));
clientApps.Stop (Seconds (490.0));

clientApps1.Start (Seconds (140.0));
clientApps1.Stop (Seconds (490.0));
clientApps2.Start (Seconds (298.0));
clientApps2.Stop (Seconds (490.0));
clientApps3.Start (Seconds (145.0));
clientApps3.Stop (Seconds (490.0));
clientApps4.Start (Seconds (200.0));
clientApps4.Stop (Seconds (490.0));

DlsrHelper dlsr;
dlsr.InstallAll ();

Simulator::Stop (Seconds (500.0));
YansWifiPhyHelper::EnablePcapAll ("wifi2");
Simulator::Run ();
Simulator::Destroy ();
return 0;

}


THE FULL OUTPUT

----------------------------

UdpEchoServerApplication:UdpEchoServer()
UdpEchoClientApplication:UdpEchoClient()
UdpEchoClientApplication:UdpEchoClient()
UdpEchoClientApplication:UdpEchoClient()
UdpEchoClientApplication:UdpEchoClient()
UdpEchoClientApplication:UdpEchoClient()
UdpEchoServerApplication:StartApplication()
UdpEchoClientApplication:StartApplication()
UdpEchoClientApplication:ScheduleTransmit()
UdpEchoClientApplication:Send()
Sent 1024 bytes to 192.168.0.15
Received 1024 bytes from 192.168.0.2
Echoing packet
SERVER READ OVER
UdpEchoClientApplication:HandleRead(0x927f798, 0x92b7b80)
Received 1024 bytes from 192.168.0.15
CLIENT READ OVER
UdpEchoClientApplication:StartApplication()
UdpEchoClientApplication:ScheduleTransmit()
UdpEchoClientApplication:Send()
Sent 1024 bytes to 192.168.0.15
Received 1024 bytes from 192.168.0.4
Echoing packet
SERVER READ OVER
UdpEchoClientApplication:HandleRead(0x927f8d8, 0x93046d8)
Received 1024 bytes from 192.168.0.15
CLIENT READ OVER
UdpEchoClientApplication:StartApplication()
UdpEchoClientApplication:ScheduleTransmit()
UdpEchoClientApplication:StartApplication()
UdpEchoClientApplication:ScheduleTransmit()
UdpEchoClientApplication:Send()
Sent 1024 bytes to 192.168.0.15
UdpEchoClientApplication:ScheduleTransmit()
UdpEchoClientApplication:Send()
Sent 1024 bytes to 192.168.0.15
Received 1024 bytes from 192.168.0.5
Echoing packet
SERVER READ OVER
UdpEchoClientApplication:HandleRead(0x927f978, 0x930ce58)
Received 1024 bytes from 192.168.0.15
CLIENT READ OVER
Received 1024 bytes from 192.168.0.3
Echoing packet
SERVER READ OVER
UdpEchoClientApplication:HandleRead(0x927f708, 0x93229a0)
Received 1024 bytes from 192.168.0.15
CLIENT READ OVER
UdpEchoClientApplication:Send()
Sent 1024 bytes to 192.168.0.15
UdpEchoClientApplication:ScheduleTransmit()
Received 1024 bytes from 192.168.0.3
Echoing packet
SERVER READ OVER
UdpEchoClientApplication:HandleRead(0x927f708, 0x93229a0)
Received 1024 bytes from 192.168.0.15
CLIENT READ OVER
UdpEchoClientApplication:Send()
Sent 1024 bytes to 192.168.0.15
UdpEchoClientApplication:ScheduleTransmit()
Received 1024 bytes from 192.168.0.3
Echoing packet
SERVER READ OVER
UdpEchoClientApplication:HandleRead(0x927f708, 0x93229a0)
Received 1024 bytes from 192.168.0.15
CLIENT READ OVER
UdpEchoClientApplication:Send()
Sent 1024 bytes to 192.168.0.15
UdpEchoClientApplication:ScheduleTransmit()
Received 1024 bytes from 192.168.0.3
Echoing packet
SERVER READ OVER
UdpEchoClientApplication:HandleRead(0x927f708, 0x93229a0)
Received 1024 bytes from 192.168.0.15
CLIENT READ OVER
UdpEchoClientApplication:Send()
Sent 1024 bytes to 192.168.0.15
UdpEchoClientApplication:ScheduleTransmit()
Received 1024 bytes from 192.168.0.3
Echoing packet
SERVER READ OVER
UdpEchoClientApplication:HandleRead(0x927f708, 0x93229a0)
Received 1024 bytes from 192.168.0.15
CLIENT READ OVER
UdpEchoClientApplication:Send()
Sent 1024 bytes to 192.168.0.15
UdpEchoClientApplication:ScheduleTransmit()
Received 1024 bytes from 192.168.0.3
Echoing packet
SERVER READ OVER
UdpEchoClientApplication:HandleRead(0x927f708, 0x93229a0)
Received 1024 bytes from 192.168.0.15
CLIENT READ OVER
UdpEchoClientApplication:Send()
Sent 1024 bytes to 192.168.0.15
UdpEchoClientApplication:ScheduleTransmit()
Received 1024 bytes from 192.168.0.3
Echoing packet
SERVER READ OVER
UdpEchoClientApplication:HandleRead(0x927f708, 0x93229a0)
Received 1024 bytes from 192.168.0.15
CLIENT READ OVER
UdpEchoClientApplication:Send()
Sent 1024 bytes to 192.168.0.15
UdpEchoClientApplication:ScheduleTransmit()
Received 1024 bytes from 192.168.0.3
Echoing packet
SERVER READ OVER
UdpEchoClientApplication:HandleRead(0x927f708, 0x93229a0)
Received 1024 bytes from 192.168.0.15
CLIENT READ OVER
UdpEchoClientApplication:Send()
Sent 1024 bytes to 192.168.0.15
Received 1024 bytes from 192.168.0.3
Echoing packet
SERVER READ OVER
UdpEchoClientApplication:HandleRead(0x927f708, 0x93229a0)
Received 1024 bytes from 192.168.0.15
CLIENT READ OVER
UdpEchoClientApplication:StartApplication()
UdpEchoClientApplication:ScheduleTransmit()
UdpEchoClientApplication:Send()
Sent 1024 bytes to 192.168.0.15
Received 1024 bytes from 192.168.0.1
Echoing packet
SERVER READ OVER
UdpEchoClientApplication:HandleRead(0x927f838, 0x92e2a10)
Received 1024 bytes from 192.168.0.15
CLIENT READ OVER
Command ['/home/Navin/Documents/ns-3.3/build/debug/scratch/wifi-olsr']
exited with code -11

Thank you.

Mathieu Lacage

unread,
Apr 15, 2009, 4:29:29 AM4/15/09
to ns-3-...@googlegroups.com
I filed a bug to keep track of this issue:
http://www.nsnam.org/bugzilla/show_bug.cgi?id=547

feel free to add more comments there.

Mathieu Lacage

unread,
Apr 16, 2009, 5:25:30 AM4/16/09
to ns-3-...@googlegroups.com
I tried to reproduce the problem but I can't. If you want to get more
help, you will have to provide a testcase we can run to reproduce the
problem.

Mathieu

Nav

unread,
Apr 16, 2009, 6:20:15 AM4/16/09
to ns-3-users
Thanx a lot, Mathieu. After you posted the bug report at bugzilla, I
decided to do more rigourous testing on my code. After about 5 to 6
hours of debugging, I realised that the error was due to a function
that I had written for erasing all tuples of a new vector set that i
had created. After correcting the error, I stil haven't been able to
find out why it worked for some cases, but caused an error in others.
Now that I have fixed the code, everything seems to be working fine.
My sincere apologies for all the trouble I caused you.

Here is the piece of code that was causing the problems:

//error
void
RoutingTable::EraseAllTrafficLogTuple ()
{
for (TrafficLogSet::iterator it = m_trafficLog.begin ();
it != m_trafficLog.end (); it++)
{
m_trafficLog.erase (it);

}
}

This is the correction I made, that made the code work properly:

//correct
void
RoutingTable::EraseAllTrafficLogTuple ()
{
bool notOver=true;

while(notOver)
{
notOver=false;
for (TrafficLogSet::iterator it = m_trafficLog.begin ();
it != m_trafficLog.end (); it++)
{
m_trafficLog.erase (it);
notOver=true;
break;
}
}

}


Sorry for the trouble once again.

Thanking you,
Navin.
Reply all
Reply to author
Forward
0 new messages