ErwinLi opened issue #1062: LteHelper.InstallEnbDevice raise NS_ASSERT failed in Python binding at nsnam / ns-3-dev

ErwinLi
2024-04-09T16:35:22Z

Environment:

OS: Ubuntu 20.04

Python Version: 3.10.14

ns-3 Version: Tried both pre-built ns3-3.4.0 (via pip install ns3) and self-built 3.4.1

Issue Description:

When attempting to use LteHelper.InstallEnbDevice in an ns-3 simulation, the program terminates unexpectedly with an NS_ASSERT failure and a subsequent NS_FATAL error. This issue occurs consistently across both the pre-built and self-compiled versions of ns-3 on my setup.

Error output:

NS_ASSERT failed, cond="uid <= m_information.size() && uid != 0", +0.000000000s -1 file=/home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/core/model/type-id.cc, line=460
NS_FATAL, terminating

Details:

>>> from ns import ns
>>> ltehelper = ns.LteHelper()
>>>
>>> enbcont = ns.NodeContainer()
>>> enbcont.Create(1)
>>>
>>> mobilityhelper = ns.MobilityHelper()
>>> mobilityhelper.SetMobilityModel("ns3::ConstantPositionMobilityModel")
>>> mobilityhelper.Install(enbcont)
>>>
>>> ns.BuildingsHelper.Install(enbcont)
>>> enbdev = ns.NetDeviceContainer()
>>> enbdev = ltehelper.InstallEnbDevice(enbcont)
NS_ASSERT failed, cond="uid <= m_information.size() && uid != 0", +0.000000000s -1 file=/home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/core/model/type-id.cc, line=460
NS_FATAL, terminating
*** Break *** abort
#0 0x00007fc895a71c3a in __GI___wait4 (pid=2471408, stat_loc=stat_loc
entry=0x7ffff7a61048, options=options
entry=0, usage=usage
entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:27
#1 0x00007fc895a71bfb in __GI___waitpid (pid=<optimised out>, stat_loc=stat_loc
entry=0x7ffff7a61048, options=options
entry=0) at waitpid.c:38
#2 0x00007fc8959e0f67 in do_system (line=<optimised out>) at ../sysdeps/posix/system.c:172
#3 0x00007fc894bac725 in CppyyLegacy::TUnixSystem::StackTrace() () from /home/yl1118/miniconda3/envs/ns341/lib/python3.10/site-packages/cppyy_backend/lib/libCoreLegacy.so
#4 0x00007fc8904bc352 in (anonymous namespace)::TExceptionHandlerImp::HandleException(int) () from /home/yl1118/miniconda3/envs/ns341/lib/python3.10/site-packages/cppyy_backend/lib/libcppyy_backend.so
#5 0x00007fc894bab231 in CppyyLegacy::TUnixSystem::DispatchSignals(CppyyLegacy::ESignals) () from /home/yl1118/miniconda3/envs/ns341/lib/python3.10/site-packages/cppyy_backend/lib/libCoreLegacy.so
#6 <signal handler called>
#7 __GI_raise (sig=sig
entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#8 0x00007fc8959b1859 in __GI_abort () at abort.c:79
#9 0x00007fc894d6a35a in __cxxabiv1::__terminate (handler=<optimised out>) at /opt/conda/conda-bld/gcc-compiler_1654084175708/work/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
#10 0x00007fc894d6a3c5 in std::terminate () at /opt/conda/conda-bld/gcc-compiler_1654084175708/work/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
#11 0x00007fc88ddfa49b in ns3::IidManager::LookupInformation (this=<optimised out>, uid=<optimised out>) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/core/model/type-id.cc:460
#12 0x00007fc88ddfc15f in ns3::IidManager::GetConstructor (this=0x7fc88df35d80 <ns3::Singleton<ns3::IidManager>::Get()::object>, uid=<optimised out>) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/core/model/type-id.cc:591
#13 0x00007fc88de011ee in ns3::TypeId::GetConstructor (this=this
entry=0x17a95320) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/core/model/type-id.cc:1087
#14 0x00007fc88de70cb1 in ns3::ObjectFactory::Create (this=this
entry=0x17a95320) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/core/model/object-factory.cc:96
#15 0x00007fc88b24d0fa in ns3::LteHelper::ChannelModelInitialization (this=0x17a951c0) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/lte/helper/lte-helper.cc:239
#16 0x00007fc88b261307 in ns3::LteHelper::DoInitialize (this=0x17a951c0) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/lte/helper/lte-helper.cc:97
#17 0x00007fc88de1ba6b in ns3::Object::Initialize (this=this
entry=0x17a951c0) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/core/model/object.cc:204
#18 0x00007fc88b260e5d in ns3::LteHelper::InstallEnbDevice (this=0x17a951c0, c=...) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/lte/helper/lte-helper.cc:488
#19 0x00007fc88aa1f134 in ?? ()
#20 0x0000000000000001 in ?? ()
#21 0x00007ffff7a64860 in ?? ()
#22 0x00000000136344a8 in ?? ()
#23 0x0000000194aff6ec in ?? ()
#24 0x000000000e63f620 in ?? ()
#25 0x000000000e63f628 in ?? ()
#26 0x000000000e63f628 in ?? ()
#27 0xa54bcc88cf059f00 in ?? ()
#28 0x0000000018e04b80 in ?? ()
#29 0xa54bcc88cf059f00 in ?? ()
#30 0x0000000018deb450 in ?? ()
#31 0x00007ffff7a64bf0 in ?? ()
#32 0x0000000018dd3900 in ?? ()
#33 0x0000000017a951c0 in ?? ()
#34 0x0000000000000000 in ?? ()
*** Break *** abort
#0 0x00007fc895a71c3a in __GI___wait4 (pid=2471560, stat_loc=stat_loc
entry=0x7ffff7a61048, options=options
entry=0, usage=usage
entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:27
#1 0x00007fc895a71bfb in __GI___waitpid (pid=<optimised out>, stat_loc=stat_loc
entry=0x7ffff7a61048, options=options
entry=0) at waitpid.c:38
#2 0x00007fc8959e0f67 in do_system (line=<optimised out>) at ../sysdeps/posix/system.c:172
#3 0x00007fc894bac725 in CppyyLegacy::TUnixSystem::StackTrace() () from /home/yl1118/miniconda3/envs/ns341/lib/python3.10/site-packages/cppyy_backend/lib/libCoreLegacy.so
#4 0x00007fc8904bc1de in (anonymous namespace)::TExceptionHandlerImp::HandleException(int) () from /home/yl1118/miniconda3/envs/ns341/lib/python3.10/site-packages/cppyy_backend/lib/libcppyy_backend.so
#5 0x00007fc894bab231 in CppyyLegacy::TUnixSystem::DispatchSignals(CppyyLegacy::ESignals) () from /home/yl1118/miniconda3/envs/ns341/lib/python3.10/site-packages/cppyy_backend/lib/libCoreLegacy.so
#6 <signal handler called>
#7 __GI_raise (sig=sig
entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#8 0x00007fc8959b1859 in __GI_abort () at abort.c:79
#9 0x00007fc894d6a35a in __cxxabiv1::__terminate (handler=<optimised out>) at /opt/conda/conda-bld/gcc-compiler_1654084175708/work/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
#10 0x00007fc894d6a3c5 in std::terminate () at /opt/conda/conda-bld/gcc-compiler_1654084175708/work/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
#11 0x00007fc88ddfa49b in ns3::IidManager::LookupInformation (this=<optimised out>, uid=<optimised out>) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/core/model/type-id.cc:460
#12 0x00007fc88ddfc15f in ns3::IidManager::GetConstructor (this=0x7fc88df35d80 <ns3::Singleton<ns3::IidManager>::Get()::object>, uid=<optimised out>) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/core/model/type-id.cc:591
#13 0x00007fc88de011ee in ns3::TypeId::GetConstructor (this=this
entry=0x17a95320) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/core/model/type-id.cc:1087
#14 0x00007fc88de70cb1 in ns3::ObjectFactory::Create (this=this
entry=0x17a95320) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/core/model/object-factory.cc:96
#15 0x00007fc88b24d0fa in ns3::LteHelper::ChannelModelInitialization (this=0x17a951c0) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/lte/helper/lte-helper.cc:239
#16 0x00007fc88b261307 in ns3::LteHelper::DoInitialize (this=0x17a951c0) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/lte/helper/lte-helper.cc:97
#17 0x00007fc88de1ba6b in ns3::Object::Initialize (this=this
entry=0x17a951c0) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/core/model/object.cc:204
#18 0x00007fc88b260e5d in ns3::LteHelper::InstallEnbDevice (this=0x17a951c0, c=...) at /home/yl1118/Desktop/ns-allinone-3.41/ns-3.41/src/lte/helper/lte-helper.cc:488
#19 0x00007fc88aa1f134 in ?? ()
#20 0x0000000000000001 in ?? ()
#21 0x00007ffff7a64860 in ?? ()
#22 0x00000000136344a8 in ?? ()
#23 0x0000000194aff6ec in ?? ()
#24 0x000000000e63f620 in ?? ()
#25 0x000000000e63f628 in ?? ()
#26 0x000000000e63f628 in ?? ()
#27 0xa54bcc88cf059f00 in ?? ()
#28 0x0000000018e04b80 in ?? ()
#29 0xa54bcc88cf059f00 in ?? ()
#30 0x0000000018deb450 in ?? ()
#31 0x00007ffff7a64bf0 in ?? ()
#32 0x0000000018dd3900 in ?? ()
#33 0x0000000017a951c0 in ?? ()
#34 0x0000000000000000 in ?? ()