ns3 buffer.h error

1,001 views
Skip to first unread message

Olfa ben Rhayem

unread,
Apr 13, 2014, 6:15:10 AM4/13/14
to ns-3-...@googlegroups.com
when running a .cc file 
i get this error;
can anyone kindly tell me what might be causing this error and how to solve it.
"
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=823  "

Olfa ben Rhayem

unread,
Apr 13, 2014, 6:58:08 AM4/13/14
to ns-3-...@googlegroups.com
i don't modified anything
please sir, i read the buffer.h file
the error is exactly in the following  code   (GetReadErrorMessage ());  )
I'm a beguinner in ns-3, please, could you help me more
Thank you very mush in advance.

uint8_t
Buffer::Iterator::ReadU8 (void)
{
  NS_ASSERT_MSG (m_current >= m_dataStart &&
                 m_current <= m_dataEnd,
                 GetReadErrorMessage ());

  if (m_current < m_zeroStart)
    {
      uint8_t data = m_data[m_current];
      m_current++;
      return data;
    }
  else if (m_current < m_zeroEnd)
    {
      m_current++;
      return 0;
    }
  else
    {
      uint8_t data = m_data[m_current - (m_zeroEnd-m_zeroStart)];
      m_current++;
      return data;
    }
}

On Sunday, April 13, 2014 11:43:00 AM UTC+1, Konstantinos wrote:
The output is clear. You are trying to read from a packet/header more than what it is actually there.
Try to run the scenario under debugger to check where this happens. 
Is this error coming from default operation or have you modified something (added/removed a header/tag)? 

Olfa ben Rhayem

unread,
Apr 13, 2014, 7:13:59 AM4/13/14
to ns-3-...@googlegroups.com
I think that there is some modification in the buffer.h (done by others)
because i'm trying to install the 

ns3-h264-svc

Please could you help me to solve this error

Konstantinos

unread,
Apr 13, 2014, 7:16:37 AM4/13/14
to ns-3-...@googlegroups.com
Yes, the error may finally come to the Buffer class, however it is generated from your scenario.
Could you run the scenario under debugger and give the output of backtrace?
Check for similar discussions and how they were solved

Olfa ben Rhayem

unread,
Apr 13, 2014, 8:11:16 AM4/13/14
to ns-3-...@googlegroups.com
hank you for your reply. I have done as you said.However, it
did't work.
alwayes when i wrote
 (gdb) backtrace
i got:

No stack

what does it mean please !!

Konstantinos

unread,
Apr 13, 2014, 8:21:42 AM4/13/14
to ns-3-...@googlegroups.com
when you are in gdb, did you call "run" ?

Olfa ben Rhayem

unread,
Apr 13, 2014, 8:30:16 AM4/13/14
to ns-3-...@googlegroups.com
finally it work, when i type:  run, then backtrace
the results is :

(gdb) backtrace
#0  0x00130416 in __kernel_vsyscall ()
#1  0x0215fcff in __GI_raise (sig=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0x02163325 in __GI_abort () at abort.c:92
#3  0x020954ed in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/i386-linux-gnu/libstdc++.so.6
#4  0x02093283 in ?? () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#5  0x020932bf in std::terminate() ()
   from /usr/lib/i386-linux-gnu/libstdc++.so.6
#6  0x003f0967 in ns3::Buffer::Iterator::ReadU8 (this=0xbfffe5b0)
    at ./ns3/buffer.h:821
#7  0x01ceed3c in ns3::Buffer::Iterator::SlowReadNtohU32 (this=0xbfffe5b0)
    at ../src/network/model/buffer.cc:1064
#8  0x00512c0b in ns3::Buffer::Iterator::ReadNtohU32 (this=0xbfffe5b0)
    at ./ns3/buffer.h:804
#9  0x00f03b4b in ns3::H264TraceHeader::Deserialize (this=0xbfffe79c, 
    start=...) at ../src/applications/model/h264-trace-header.cc:186
#10 0x01d1581a in ns3::Packet::RemoveHeader (this=0x80b66a0, header=...)
    at ../src/network/model/packet.cc:287
#11 0x00efec17 in ns3::UdpH264Server::HandleRead (this=0x80b53e8, socket=...)
    at ../src/applications/model/udp-h264-server.cc:165
#12 0x00f00269 in ns3::MemPtrCallbackImpl<ns3::UdpH264Server*, void (ns3::UdpH264Server::*)(ns3::Ptr<ns3::Socket>), void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3---Type <return> to continue, or q <return> to quit---

BNR INFO

unread,
Apr 13, 2014, 10:03:16 AM4/13/14
to ns-3-...@googlegroups.com

Please sir,

I send you tha backtrace result
and  i'm still have the same error (attched picture).
Can you tell me kindly how to solve it

Tommaso Pecorella

unread,
Apr 13, 2014, 10:53:21 AM4/13/14
to ns-3-...@googlegroups.com


On Sunday, April 13, 2014 4:03:16 PM UTC+2, BNR INFO wrote:

Please sir,

I send you tha backtrace result

and  i'm still have the same error (attched picture).
Can you tell me kindly how to solve it

Hi,

Kostantinos already told you how to fix your problem. use a debugger and find where the program fails.
That's all you'll get from us. Not because we don't want to help more. Because we CAN'T.

Think about it. You have your sources. You applied a patch we don't have. You're running a script we don't know. How can we possibly fix your problem ?

The debugger is clearly telling you where the problem is. Kostantinos told you before: it's a header being deserialized in the wrong way.
#9  0x00f03b4b in ns3::H264TraceHeader::Deserialize (this=0xbfffe79c, 
    start=...) at ../src/applications/model/h264-trace-header.cc:186
#10 0x01d1581a in ns3::Packet::RemoveHeader (this=0x80b66a0, header=...)
    at ../src/network/model/packet.cc:287
#11 0x00efec17 in ns3::UdpH264Server::HandleRead (this=0x80b53e8, socket=...)
    at ../src/applications/model/udp-h264-server.cc:165
 
The UdpH264Server received a packet. It's trying to remove an header. The header is either:
1) not there
2) incomplete
3) whatever

How to fix it ? Stop thinking somebody can fix it magically. Only you (or someone who can check your code) can.
By the way, you can configure Eclipse and Netbeans and use the debugger GUI if you don't want to use gdb. Or you can use any other gdb frontend.
However, you will have to debug the code. 

or... you could install TeamViewer and let me browse your PC. But be sure that I'll also post online all the credit card data, bank accounts and porno I'll find there.
[I'm joking, I wouldn't fix your program, I'd just post the porno].

T.

BNR INFO

unread,
Apr 13, 2014, 11:37:25 AM4/13/14
to ns-3-...@googlegroups.com
Thank you for these details
It is not my prpoer code, i'm trying to install ns3-h264-svc ( https://github.com/georgemouse/ns3-h264-svc
and do  some modifications to simulate SVC over MANET.

no issues, I let you browse my PC now.
ok?

Konstantinos

unread,
Apr 13, 2014, 6:43:00 AM4/13/14
to ns-3-...@googlegroups.com
The output is clear. You are trying to read from a packet/header more than what it is actually there.
Try to run the scenario under debugger to check where this happens. 
Is this error coming from default operation or have you modified something (added/removed a header/tag)? 

On Sunday, April 13, 2014 11:15:10 AM UTC+1, Olfa ben Rhayem wrote:
Reply all
Reply to author
Forward
0 new messages