sigsegv error

141 views
Skip to first unread message

mohamed...@gmail.com

unread,
Jun 13, 2016, 6:44:35 PM6/13/16
to ns-3-users
thanks in advanced
i have modified simple lena epc an every and  thing was good until i try to add more remote hosts the debugger has the following message.
Program received signal SIGSEGV, Segmentation fault.
0xb71c2439 in ns3::Object::GetObject<ns3::Ipv4L3Protocol> (this=0x0)
    at ./ns3/object.h:459
459      T *result = dynamic_cast<T *> (m_aggregates->buffer[0]);
------------------------------------------------------
my code in the attachment and i followed the steps in this link .i try hard to find where the error but i fail please help me

https://groups.google.com/forum/#!searchin/ns-3-users/LTE$20Round$20Robin$20scheduler$20vs$20Priority$20Set$2C$20Token$20Bank$20and$20Proportional$20Fair/ns-3-users/k8TVOCOKhjA/2XGSuBxErZoJ

mylena-v4.cc

Tommaso Pecorella

unread,
Jun 13, 2016, 7:40:41 PM6/13/16
to ns-3-users
http://bfy.tw/6FfF
and

Or, if you really want that I spoil the fun, it's not wise to search for a non-existent node.

T.

mohamed...@gmail.com

unread,
Jun 15, 2016, 12:44:59 AM6/15/16
to ns-3-users
thanks tommaso very much for response i have know the meaning of sigsegv but i have try hard to know  where is the error in my code but i could not i just follow the steps in my lena-simple-epc can any one please tell me where is the error
sorry for my silly bothering questionbut i really tried but i do not know what to do more


On Tuesday, June 14, 2016 at 12:44:35 AM UTC+2, mohamed...@gmail.com wrote:

Tommaso Pecorella

unread,
Jun 15, 2016, 4:50:33 AM6/15/16
to ns-3-users
Use a debugger. Where it stops, there's the error line.

T.

mohamed abdelgwad

unread,
Jun 15, 2016, 9:41:42 AM6/15/16
to ns-3-...@googlegroups.com
thanka tommaso
but i used debugger already from beginning as shown in the  above image
and the debugger show that the problem in get object function but i do not what is the problem happened when calling get object function



--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Tommaso Pecorella

unread,
Jun 15, 2016, 10:03:03 AM6/15/16
to ns-3-users
You did launch the program in a debugger, but you didn't use the debugger.

The image only say that you tried to are trying to use an object through a null pointer.
It doesn't say where the object was called, and why. For that you need to do something more than just to run the program in gdb.
Read this: http://www.cprogramming.com/debugging/segfaults.html
and pay attention to how to find the function call chain.

T.

mohamed...@gmail.com

unread,
Jun 15, 2016, 11:37:47 AM6/15/16
to ns-3-users
thanks tommaso for helping i found the error in the line
  flowmon.Install(enbNodes.Get(1));
i must change it to
  flowmon.Install(enbNodes.Get(0));
sorry for being bothering and thanks for being helpful and patience

Tommaso Pecorella

unread,
Jun 15, 2016, 12:49:05 PM6/15/16
to ns-3-users
I'm happy you have found it. The goal of all this is learning, and I hope you did learn something (how to use the backtrace).

Cheers,

T.

Arpita Chopra

unread,
Jul 13, 2018, 7:01:30 AM7/13/18
to ns-3-users
I am getting sigsegv error, After doing backtrace the output is like that -

#0  _IO_vfprintf_internal (s=s@entry=0x7fffff7ff540, format=format@entry=0x7fffff7ff830 "%.*g", ap=ap@entry=0x7fffff7ff6a8) at vfprintf.c:1332
#1  0x00007fffeb741499 in _IO_vsnprintf (string=0x7fffff7ff7a0 "", maxlen=<optimized out>, format=0x7fffff7ff830 "%.*g", args=0x7fffff7ff6a8)
    at vsnprintf.c:119
#2  0x00007fffec27a6ff in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007fffec280f84 in std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_float<double>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, char, double) const ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007fffec28c87c in std::ostream& std::ostream::_M_insert<double>(double) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff33b0d42 in ns3::Ipv4L3ProtocolRxSinkWithoutContext(ns3::Ptr<ns3::OutputStreamWrapper>, ns3::Ptr<ns3::Packet const>, ns3::Ptr<ns3::Ipv4>, unsigned int) () from /home/usrp-1/ns-3-dev/build/libns3-dev-internet-debug.so
#6  0x00007ffff33c1bdd in ns3::BoundFunctorCallbackImpl<void (*)(ns3::Ptr<ns3::OutputStreamWrapper>, ns3::Ptr<ns3::Packet const>, ns3::Ptr<ns3::Ipv4>, unsigned int), void, ns3::Ptr<ns3::OutputStreamWrapper>, ns3::Ptr<ns3::Packet const>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Packet const>, ns3::Ptr<ns3::Ipv4>, unsigned int) ()
   from /home/usrp-1/ns-3-dev/build/libns3-dev-internet-debug.so
#7  0x00007ffff316a7db in ns3::Callback<void, ns3::Ptr<ns3::Packet const>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Packet const>, ns3::Ptr<ns3::Ipv4>, unsigned int) const ()
   from /home/usrp-1/ns-3-dev/build/libns3-dev-internet-debug.so
#8  0x00007ffff3166427 in ns3::TracedCallback<ns3::Ptr<ns3::Packet const>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Packet const>, ns3::Ptr<ns3::Ipv4>, unsigned int) const ()
   from /home/usrp-1/ns-3-dev/build/libns3-dev-internet-debug.so
#9  0x00007ffff3152658 in ns3::Ipv4L3Protocol::Receive(ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType) () from /home/usrp-1/ns-3-dev/build/libns3-dev-internet-debug.so
#10 0x00007ffff317d540 in ns3::MemPtrCallbackImpl<ns3::Ipv4L3Protocol*, void (ns3::Ipv4L3Protocol::*)(ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType), void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType) () from /home/usrp-1/ns-3-dev/build/libns3-dev-internet-debug.so
#11 0x00007ffff249b7bd in ns3::Callback<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType) const ()
   from /home/usrp-1/ns-3-dev/build/libns3-dev-traffic-control-debug.so
#12 0x00007ffff249880a in ns3::TrafficControlLayer::Receive(ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType) () from /home/usrp-1/ns-3-dev/build/libns3-dev-traffic-control-debug.so
#13 0x00007ffff314535d in ns3::Ipv4Interface::Send(ns3::Ptr<ns3::Packet>, ns3::Ipv4Header const&, ns3::Ipv4Address) ()
   from /home/usrp-1/ns-3-dev/build/libns3-dev-internet-debug.so
#14 0x00007ffff31586c5 in ns3::Ipv4L3Protocol::SendRealOut(ns3::Ptr<ns3::Ipv4Route>, ns3::Ptr<ns3::Packet>, ns3::Ipv4Header const&) ()
   from /home/usrp-1/ns-3-dev/build/libns3-dev-internet-debug.so
#15 0x00007ffff3155c37 in ns3::Ipv4L3Protocol::Send(ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>) () from /home/usrp-1/ns-3-dev/build/libns3-dev-internet-debug.so

Don't know how to resolve it.
Reply all
Reply to author
Forward
0 new messages