Whener I call the Simulator to run the 2nd time I get an assertion

65 views
Skip to first unread message

Couto

unread,
Aug 16, 2023, 12:27:49 PM8/16/23
to ns-3-users
+0.000000000s 0 ndn.Consumer:Consumer()
+0.000000000s 8 ndn.Producer:Producer()
ns3.35-ndnBlock-debug: /usr/include/boost/graph/two_bit_color_map.hpp:88: void boost::put(const boost::two_bit_color_map<IndexMap>&, typename boost::property_traits<PMap>::key_type, boost::two_bit_color_type) [with IndexMap = boost::VertexIds; typename boost::property_traits<PMap>::key_type = ns3::Ptr<ns3::ndn::GlobalRouter>]: Assertion `(std::size_t)i < pm.n' failed.
Command ['/home/couto/Desktop/ndnSIM/ns-3/build/src/ndnSIM/examples/ns3.35-ndnBlock-debug'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --gdb").




i get this error 
I can give the code and more if you want please help me guys


Other question is how I put data in the content store

Tom Henderson

unread,
Aug 17, 2023, 12:26:12 PM8/17/23
to ns-3-...@googlegroups.com, Couto
https://www.nsnam.org/wiki/HOWTO_use_gdb_to_debug_program_errors

When the program breaks in gdb, use the backtrace ('bt') command to
inspect the call history that led to the assertion.

https://www.thegeekstuff.com/2014/01/gdb-backtrace/

- Tom
> --
> Posting to this group should follow these guidelines
> https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> <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
> <mailto:ns-3-users+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ns-3-users/2f332abb-cde8-489c-91c5-13d357fb55b5n%40googlegroups.com <https://groups.google.com/d/msgid/ns-3-users/2f332abb-cde8-489c-91c5-13d357fb55b5n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Couto

unread,
Aug 18, 2023, 4:19:07 PM8/18/23
to ns-3-users
: /64a0fe53ab9c6c59fb262b6e3e982a5185829f7a27eac2ef4c23aa43065d8a11/seq=198
Hash matches. The chunk 1 is unaltered.
URL: http://localhost:5000/api/request_chunk/2?filename=file.pdf
Chunk 1d8e3aee8d4f4548424f60b02bec705d225a1c05b30a68d43a47a57f526080cf downloaded successfully

+0.000000000s 0 ndn.Consumer:Consumer()
+0.000000000s 8 ndn.Producer:Producer()
ns3.35-ndnBlock-debug: /usr/include/boost/graph/two_bit_color_map.hpp:88: void boost::put(const boost::two_bit_color_map<IndexMap>&, typename boost::property_traits<PMap>::key_type, boost::two_bit_color_type) [with IndexMap = boost::VertexIds; typename boost::property_traits<PMap>::key_type = ns3::Ptr<ns3::ndn::GlobalRouter>]: Assertion `(std::size_t)i < pm.n' failed.

Program received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737287482112) at ./nptl/pthread_kill.c:44
44 ./nptl/pthread_kill.c: No such file or directory.
(gdb)



so I cant destroy here?

    Simulator::Stop(Seconds(20.0));

    Simulator::Run();
    Simulator::Destroy();

George Frangulea

unread,
Aug 18, 2023, 6:29:52 PM8/18/23
to ns-3-users

Here is an example that runs a simulation for a certain duration of time: 
https://gitlab.com/cttc-lena/nr-u/-/blob/master/examples/cttc-nr-wifi-interference.cc?ref_type=heads

Also, did u run the simulation under gdb as Tom suggested? Is that the full trace u get? 
./waf --run <program> --gdb"
once in gdb do :
run
once u get the assertion happens do:
backtrace

Couto

unread,
Aug 18, 2023, 7:08:14 PM8/18/23
to ns-3-users
thanks for the example!
with bt i get this:

19.919040000s 0 ndn.Consumer:OnData(): [DEBUG] Hop count: 4
+19.942944000s 8 ndn.Producer:OnInterest(0x555555838c90, 0x55555592cf10)
+19.942944000s 8 ndn.Producer:OnInterest(): [INFO ] node(8) responding with Data: /64a0fe53ab9c6c59fb262b6e3e982a5185829f7a27eac2ef4c23aa43065d8a11/seq=198

Hash matches. The chunk 1 is unaltered.
URL: http://localhost:5000/api/request_chunk/2?filename=file.pdf
Chunk 1d8e3aee8d4f4548424f60b02bec705d225a1c05b30a68d43a47a57f526080cf downloaded successfully
msg="Cannot re-install NDN stack on node 0", +20.000000000s -1 file=../src/ndnSIM/helper/ndn-stack-helper.cpp, line=153
terminate called without an active exception


Program received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737287482112) at ./nptl/pthread_kill.c:44
44 ./nptl/pthread_kill.c: No such file or directory.
(gdb) backtrace
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737287482112)
    at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737287482112)
    at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737287482112, signo=signo@entry=6)
    at ./nptl/pthread_kill.c:89
#3  0x00007ffff0c42476 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/posix/raise.c:26
#4  0x00007ffff0c287f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff10a2b9e in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff10ae20c in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007ffff10ae277 in std::terminate() ()
   from /lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x00007ffff6deff86 in ns3::ndn::StackHelper::Install (this=0x7fffffffd1a0,
    node=...) at ../src/ndnSIM/helper/ndn-stack-helper.cpp:153
#9  0x00007ffff6defcd9 in ns3::ndn::StackHelper::Install (this=0x7fffffffd1a0,
    c=...) at ../src/ndnSIM/helper/ndn-stack-helper.cpp:139
#10 0x00007ffff6defd91 in ns3::ndn::StackHelper::InstallAll (
    this=0x7fffffffd1a0) at ../src/ndnSIM/helper/ndn-stack-helper.cpp:146
#11 0x00005555555dab58 in ns3::runNDNSimulation (
    prefix="/1d8e3aee8d4f4548424f60b02bec705d225a1c05b30a68d43a47a57f526080cf")
    at ../src/ndnSIM/examples/ndnBlock.cpp:133
#12 0x00005555555dd635 in ns3::handle_download (filename="file.pdf",
--Type <RET> for more, q to quit, c to continue without paging--
    start_chunk=1, end_chunk=3) at ../src/ndnSIM/examples/ndnBlock.cpp:432
#13 0x00005555555dc3f6 in ns3::execute ()
    at ../src/ndnSIM/examples/ndnBlock.cpp:311
#14 0x00005555555db6e5 in ns3::main (argc=1, argv=0x7fffffffdd48)
    at ../src/ndnSIM/examples/ndnBlock.cpp:206
#15 0x00005555555dea1e in main (argc=1, argv=0x7fffffffdd48)
    at ../src/ndnSIM/examples/ndnBlock.cpp:548
(gdb)

I need to change the prefix, thats my problem.

Can I get your discord or email or something?

George Frangulea

unread,
Aug 18, 2023, 7:30:52 PM8/18/23
to ns-3-users
It tells you the line where this issue occurs /ndn-stack-helper.cpp, line=153 . 
Have you tried looking what happens in    StackHelper::Install(Ptr<Node> node). At first look it seems is a check to prevent installing NDN sack a 2nd time on that NodeId 0. 

Also try asking ChatGPT (openai.com). Just feed backtraces into it if you`re lazy reading them. Then feed that StakHelper code to help you understand what happens there. 
Definitely it has more time than anyone else has for work in August. 
Reply all
Reply to author
Forward
0 new messages