Bugzilla – Bug 1404
Random walk mobility model: assert failed. cond="m_bounds.IsInside (position)"
Last modified: 2012-05-04 19:33:49 UTC
Reported by Mike Moreton <mjvm_ns@hotmail.com> to the ns-developers mailing list. Reproduced: $./waf --run="examples/tutorial/third --nWifi=100" Waf: Entering directory `/home/boyko/wk/ns-3-dev/build' Waf: Leaving directory `/home/boyko/wk/ns-3-dev/build' 'build' finished successfully (1.094s) assert failed. cond="m_bounds.IsInside (position)", file=../src/mobility/model/random-walk-2d-mobility-model.cc, line=166 terminate called without an active exception Command ['/home/boyko/wk/ns-3-dev/build/examples/tutorial/ns3-dev-third-debug', '--nWifi=100'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>"). Backtrace: Program terminated with signal 6, Aborted. #0 0x00007fe9c541d3a5 in raise () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) bt #0 0x00007fe9c541d3a5 in raise () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007fe9c5420b0b in abort () from /lib/x86_64-linux-gnu/libc.so.6 #2 0x00007fe9c5efad7d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #3 0x00007fe9c5ef8f26 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #4 0x00007fe9c5ef8f53 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #5 0x00007fe9c6a731a9 in ns3::RandomWalk2dMobilityModel::DoSetPosition (this=0x26109a0, position=...) at ../src/mobility/model/random-walk-2d-mobility-model.cc:166 #6 0x00007fe9c6a641b2 in ns3::MobilityModel::SetPosition (this=0x26109a0, position=...) at ../src/mobility/model/mobility-model.cc:75 #7 0x00007fe9c6a82a69 in ns3::MobilityHelper::Install (this=0x7fffe9881d60, node=...) at ../src/mobility/helper/mobility-helper.cc:158 #8 0x00007fe9c6a82fce in ns3::MobilityHelper::Install (this=0x7fffe9881d60, c=...) at ../src/mobility/helper/mobility-helper.cc:172 #9 0x000000000040e948 in main (argc=2, argv=0x7fffe9882f28) at ../examples/tutorial/third.cc:121 (gdb)
The problem here is that the combination of the position allocator and mobility model configuration does not permit arbitrarily large numbers of wifi stations. mobility.SetPositionAllocator ("ns3::GridPositionAllocator", "MinX", DoubleValue (0.0), "MinY", DoubleValue (0.0), "DeltaX", DoubleValue (5.0), "DeltaY", DoubleValue (10.0), "GridWidth", UintegerValue (3), "LayoutType", StringValue ("RowFirst")); mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel", "Bounds", RectangleValue (Rectangle (-50, 50, -50, 50))); This starts to segfault at --nWifi > 18 when the initial layout of nodes goes beyond the bounding box. Will fix in a minimal way that doesn't require too much touching of the tutorial text; specifically, to enforce that --nWifi <= 18.
fixed: changeset 0e14523a87fd