Assert failed in buffer.h

80 views
Skip to first unread message

Lucas Yan

unread,
May 14, 2018, 8:46:09 AM5/14/18
to ns-3-users
Hi,

When running my program, i've got the following error:

assert failed. cond="m_current >= m_dataStart && m_current < m_dataEnd", msg="You have attempted to read beyond the bounds of the available buffer space. This usually indicates that a Header::Deserialize or Trailer::Deserialize method is trying to read data which was not written by a Header::Serialize or Trailer::Serialize method. In short: check the code of your Serialize and Deserialize methods.", file=./ns3/buffer.h, line=1002

Running the scenario under debugger, the backtrace shows the following result:

(gdb) backtrace
#0  0x00007fffeaa1f428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007fffeaa2102a in __GI_abort () at abort.c:89
#2  0x00007fffeb57f84d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007fffeb57d6b6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007fffeb57d701 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff7b76930 in ns3::Buffer::Iterator::PeekU8 (this=0x7fffffffbcd0) at ./ns3/buffer.h:1000
#6  0x00007ffff7b769fa in ns3::Buffer::Iterator::ReadU8 (this=0x7fffffffbcd0) at ./ns3/buffer.h:1023
#7  0x00007ffff7650236 in ns3::Buffer::Iterator::ReadU16 (this=0x7fffffffbcd0) at ./ns3/buffer.h:1031
#8  0x00007ffff380d341 in ns3::DsaRsp::Deserialize (this=0x7fffffffc580, start=...) at ../src/wimax/model/mac-messages.cc:767
#9  0x00007fffef4c2ffe in ns3::Packet::RemoveHeader (this=0x80ebb0, header=...) at ../src/network/model/packet.cc:282
#10 0x00007ffff37f37a5 in ns3::SubscriberStationNetDevice::DoReceive (this=0x7691d0, packet=...) at ../src/wimax/model/ss-net-device.cc:973
#11 0x00007ffff37bd427 in ns3::WimaxNetDevice::Receive (this=0x7691d0, burst=...) at ../src/wimax/model/wimax-net-device.cc:527
#12 0x00007ffff37cc940 in ns3::MemPtrCallbackImpl<ns3::WimaxNetDevice*, void (ns3::WimaxNetDevice::*)(ns3::Ptr<ns3::PacketBurst const>), void, ns3::Ptr<ns3::PacketBurst const>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()
    (this=0x76a5c0, a1=...) at ./ns3/callback.h:612
#13 0x00007ffff5445add in ns3::Callback<void, ns3::Ptr<ns3::PacketBurst const>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator() (this=0x7fffffffc840, a1=...) at ./ns3/callback.h:1291
#14 0x00007ffff38191c1 in ns3::SimpleOfdmWimaxPhy::EndReceive (this=0x6d5540, burst=...) at ../src/wimax/model/simple-ofdm-wimax-phy.cc:480
#15 0x00007ffff381fa14 in ns3::EventImpl* ns3::MakeEvent<void (ns3::SimpleOfdmWimaxPhy::*)(ns3::Ptr<ns3::PacketBurst const>), ns3::SimpleOfdmWimaxPhy*, ns3::Ptr<ns3::PacketBurst> >(void (ns3::SimpleOfdmWimaxPhy::*)(ns3::Ptr<ns3::PacketBurst const>), ns3::SimpleOfdmWimaxPhy*, ns3::Ptr<ns3::PacketBurst>)::EventMemberImpl1::Notify() (this=0x813cf0) at ./ns3/make-event.h:406
#16 0x00007fffeed30c2f in ns3::EventImpl::Invoke (this=0x813cf0) at ../src/core/model/event-impl.cc:51
#17 0x00007fffeed360bf in ns3::DefaultSimulatorImpl::ProcessOneEvent (this=0x6ca0a0) at ../src/core/model/default-simulator-impl.cc:149
#18 0x00007fffeed364d3 in ns3::DefaultSimulatorImpl::Run (this=0x6ca0a0) at ../src/core/model/default-simulator-impl.cc:202
#19 0x00007fffeed31e63 in ns3::Simulator::Run () at ../src/core/model/simulator.cc:230
#20 0x0000000000410b09 in main (argc=1, argv=0x7fffffffdd68) at ../scratch/final.cc:194

I can not figure out what's going wrong, I would really appreaciate any kind of help

Thanks

pdbarnes

unread,
May 14, 2018, 4:28:27 PM5/14/18
to ns-3-users
The backtrace says the error is being detected in DsaRsp::Deserialize(), but that's almost certainly not where the error occurs, unless you modified it.  The error occurs because some object is serializing and deserializing a different number of bytes than claimed by the GetSerializedSize function for that object.  Look at the places you do this in your code, or have modified upstream code.

Peter
Reply all
Reply to author
Forward
Message has been deleted
0 new messages