assert failed in buffer.h at Check(m_current)

292 views
Skip to first unread message

Bo Zhang

unread,
Apr 18, 2010, 5:37:05 AM4/18/10
to ns-3-users
Hi guys,

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


assert failed. file=debug/ns3/buffer.h, line=550, cond="Check
(m_current)"
Command ['....../mercurial-1.5/ns-3.7-pyviz/build/debug/scratch/
basetier'] exited with code -11


I searched through doc, but could not find doc about ns3::Check()

Any suggestions about which direction should I go in order to solve
this kind of error? And what does Check(m_current) actually do?


Thanks a lot


Zhang Bo

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.

Pavel Boyko

unread,
Apr 18, 2010, 5:54:33 AM4/18/10
to ns-3-...@googlegroups.com
Hi, Zhang Bo,

please provide a backtrace to clarify your problem.

If you know how to dump a backtrace using gdb skip the rest of this
mail. Otherwise, this is your action:
$ ulimit -c unlimited
$ ./waf --run <you script>
...
assert failed: ...
...
$ gdb ./build/debug/<path to your script> core
(gdb) backtrace

Finally copy-paste gdb output here.

Pavel

Bo Zhang

unread,
Apr 19, 2010, 12:55:07 AM4/19/10
to ns-3-users
Hi Pavel,

Below is the backtrace.


(gdb) backtrace
#0 0x000000000041d9f3 in ns3::Buffer::Iterator::WriteU8
(this=0x40e86da0, data=252 '\374') at debug/ns3/buffer.h:550
#1 0x000000000040fe3b in ns3::locmvsp::MessageHeader::Data::Serialize
(this=0x40e87168, start=...) at ../scratch/basetier.cc:464
#2 0x00000000004110b0 in ns3::locmvsp::MessageHeader::Serialize
(this=0x40e87070, start=...) at ../scratch/basetier.cc:157
#3 0x00007f5b5e240c28 in ns3::Packet::AddHeader (this=0x1846330,
header=...) at ../src/common/packet.cc:234
#4 0x0000000000411e7d in ns3::locmvsp::GenerateData (socket=...,
data_size=512, data_interval=0.10000000000000001, id=0)
at ../scratch/basetier.cc:709
#5 0x000000000040c48c in Notify (this=0x698540) at debug/ns3/make-
event.h:342
#6 0x00007f5b5e1c8537 in ns3::EventImpl::Invoke (this=0x698540) at ../
src/simulator/event-impl.cc:37
#7 0x00007f5b5e1e4334 in ns3::DefaultSimulatorImpl::ProcessOneEvent
(this=0x68ad10) at ../src/simulator/default-simulator-impl.cc:121
#8 0x00007f5b5e1e435d in ns3::DefaultSimulatorImpl::RunOneEvent
(this=0x68ad10) at ../src/simulator/default-simulator-impl.cc:162
#9 0x00007f5b5e1d0fa6 in ns3::Simulator::RunOneEvent () at ../src/
simulator/simulator.cc:180
#10 0x00007f5b5e2b272f in ns3::PyViz::SimulatorRunUntil
(this=0x133cb70, time=...) at ../src/contrib/pyviz.cc:252
#11 0x00007f5b5ba66d72 in _wrap_PyNs3PyViz_SimulatorRunUntil
(self=0x7f5b5ef3e3d0, args=0x130bd10, kwargs=0x0)
at debug/bindings/python/ns3_module_contrib.cc:2821
#12 0x00007f5b5d254940 in PyEval_EvalFrameEx () from /usr/lib/
libpython2.5.so.1.0
#13 0x00007f5b5d255a86 in PyEval_EvalCodeEx () from /usr/lib/
libpython2.5.so.1.0
#14 0x00007f5b5d253ad7 in PyEval_EvalFrameEx () from /usr/lib/
libpython2.5.so.1.0
#15 0x00007f5b5d254893 in PyEval_EvalFrameEx () from /usr/lib/
libpython2.5.so.1.0
#16 0x00007f5b5d255a86 in PyEval_EvalCodeEx () from /usr/lib/
libpython2.5.so.1.0
#17 0x00007f5b5d1f570a in ?? () from /usr/lib/libpython2.5.so.1.0
#18 0x00007f5b5d1d3f23 in PyObject_Call () from /usr/lib/
libpython2.5.so.1.0
#19 0x00007f5b5d1db65f in ?? () from /usr/lib/libpython2.5.so.1.0
#20 0x00007f5b5d1d3f23 in PyObject_Call () from /usr/lib/
libpython2.5.so.1.0
#21 0x00007f5b5d24ea1e in PyEval_CallObjectWithKeywords () from /usr/
lib/libpython2.5.so.1.0
#22 0x00007f5b5d283eed in ?? () from /usr/lib/libpython2.5.so.1.0
#23 0x00007f5b5d9193f7 in start_thread () from /lib/libpthread.so.0
#24 0x00007f5b5c56eb4d in clone () from /lib/libc.so.6
#25 0x0000000000000000 in ?? ()


I still can not figure out what's going wrong.

BTW. I tried commented out buffer.h line 550:
NS_ASSERT(Check(m_current)), and the program seems be able to run
well. But I know that there must be something wrong to cause this
assert to fail.


Thanks a lot

Zhang Bo



> > For more options, visit this group athttp://groups.google.com/group/ns-3-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To post to this group, send email to ns-3-...@googlegroups.com.
> To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/ns-3-users?hl=en.

Mathieu Lacage

unread,
Apr 19, 2010, 2:35:41 AM4/19/10
to ns-3-...@googlegroups.com
> Any suggestions about which direction should I go in order to solve
> this kind of error? And what does Check(m_current) actually do?

You are writing past the end of the area you allocated for your
header. Chack that GetSerializedSize returns the right size.

Mathieu
--
Mathieu Lacage <mathieu...@gmail.com>

Bo Zhang

unread,
Apr 19, 2010, 3:40:05 AM4/19/10
to ns-3-users
Thanks a LOT~~~~ both of you.

I found that in one of my GetSerializedSize(), I returned the wrong
size. :(

Now it works perfectly

Thanks again!!

Regards

Zhang Bo



On Apr 19, 2:35 pm, Mathieu Lacage <mathieu.lac...@gmail.com> wrote:
> > Any suggestions about which direction should I go in order to solve
> > this kind of error? And what does Check(m_current) actually do?
>
> You are writing past the end of the area you allocated for your
> header. Chack that GetSerializedSize returns the right size.
>
> Mathieu
> --
> Mathieu Lacage <mathieu.lac...@gmail.com>
Reply all
Reply to author
Forward
0 new messages