Bugzilla – Bug 1881
assert failed. cond="address.m_len <= Address::MAX_SIZE"
Last modified: 2014-03-14 17:51:45 UTC
Created attachment 1802 [details] replace AsInt with strtoul in address.cc When trying to set default value for an 'Address' attribute using a ConfigStore the above assertion fails. Even when the value being set is the same as the default value. I used udp-trace-client-server.cc to reproduce the bug. I just read the default attribute values, then isolated these two lines without any changes in input-attributes.txt: default ns3::UdpClient::RemoteAddress "00-00-00" default ns3::UdpTraceClient::RemoteAddress "00-00-00" The configuration is loaded this way: Config::SetDefault ("ns3::ConfigStore::Filename", StringValue ("input-attributes.txt")); Config::SetDefault ("ns3::ConfigStore::Mode", StringValue ("Load")); Config::SetDefault ("ns3::ConfigStore::FileFormat", StringValue ("RawText")); ConfigStore inputConfig; inputConfig.ConfigureDefaults (); That's when the bug is triggered. Obviously any other value will trigger the 'assert fail'. I suspect it is related to the AsInt() function in address.cc, I had to replace it with strtoul to get around this problem (A patch is attached).
Hi, I have some doubts about this bug. However they're mostly academic. AsInt has been already replaced by strtoul as strtoul is 20x faster than AsInt... It's nice when you remove a bug you wasn't aware of, isn't it ? Mind updating ns-3-dev to the latest version and check that everything is working as intended ?
Indeed, it has already been fixed. I made the stupid mistake of forgetting an 'hg up'. I wasted some time on that one!.
*** This bug has been marked as a duplicate of bug 1870 ***