Error evaluating parameter `analogueModels': basic_string::_S_construct null not valid.

109 views
Skip to first unread message

Dave Mck

unread,
May 16, 2013, 1:18:44 PM5/16/13
to omn...@googlegroups.com
I have a Veins simulation running successfully from within the IDE, but it was quite slow so I decided to try to run it from the command line.

I used the following command to run the simulation (where myomnetpp.ini is my own configuration file):
./veins -u Cmdenv myomnetpp.ini

It runs successfully for a certain amount of time but crashes at the creation of vehicle id 248 with the following error:
<!> Error in module (PhyLayer80211p) myscenario.node[248].nic.phy80211p (id=1755) at event #524057, t=186: Error evaluating parameter `analogueModels': basic_string::_S_construct null not valid.


As I understand it, the error is caused by code trying to create a string from null, which is not possible. I am not sure, however, why the error occurs when running from the command line but does not show up when running from the IDE, as the IDE simulation runs without error beyond this point.

Below is also a stack trace from GDB that might help. If anybody has an ideas as to what causes the error or what I need to look for, that would be great. If you need any more information I would be happy to provide it.

TRAPPING on the exception above, due to a debug-on-errors=true configuration option. Is your debugger ready?

Program received signal SIGABRT, Aborted.
0x00007fff8f10ed46 in __kill ()
(gdb) bt
#0  0x00007fff8f10ed46 in __kill ()
#1  0x0000000100aceea8 in cRuntimeError::breakIntoDebuggerIfRequested (this=0x1029e4d30) at cexception.cc:299
#2  0x0000000100ace756 in cRuntimeError (this=0x1029e4d30, errorcode=ePARAM) at cexception.cc:240
#3  0x0000000100af9511 in cPar::convertToConst (this=0x1029e08a8) at cpar.cc:379
#4  0x0000000100af90f5 in cPar::read (this=0x1029e08a8) at cpar.cc:329
#5  0x0000000100aa72d2 in cComponent::finalizeParameters (this=0x1029e62e0) at ccomponent.cc:175
#6  0x0000000100aec031 in cModule::finalizeParameters (this=0x1029e62e0) at cmodule.cc:1065
#7  0x0000000100b87920 in cNEDNetworkBuilder::addSubmodule (this=0x7fff5fbfe450, modp=0x1029e5ae0, submod=0x102126490) at netbuilder/cnednetworkbuilder.cc:797
#8  0x0000000100b85b0c in cNEDNetworkBuilder::addSubmodulesAndConnections (this=0x7fff5fbfe450, modp=0x1029e5ae0) at netbuilder/cnednetworkbuilder.cc:496
#9  0x0000000100b85aa9 in cNEDNetworkBuilder::buildRecursively (this=0x7fff5fbfe450, modp=0x1029e5ae0, decl=0x1021d4e10) at netbuilder/cnednetworkbuilder.cc:488
#10 0x0000000100b85910 in cNEDNetworkBuilder::buildInside (this=0x7fff5fbfe450, modp=0x1029e5ae0, decl=0x1021d4e10) at netbuilder/cnednetworkbuilder.cc:461
#11 0x0000000100b833ff in cDynamicModuleType::buildInside (this=0x1021d4fd0, module=0x1029e5ae0) at netbuilder/cdynamicmoduletype.cc:87
#12 0x0000000100aba887 in cCompoundModule::doBuildInside (this=0x1029e5ae0) at ccompoundmodule.cc:50
#13 0x0000000100aec16c in cModule::buildInside (this=0x1029e5ae0) at cmodule.cc:1086
#14 0x0000000100b859b9 in cNEDNetworkBuilder::buildInside (this=0x7fff5fbfe7b0, modp=0x1029e3240, decl=0x1021e0e00) at netbuilder/cnednetworkbuilder.cc:473
#15 0x0000000100b833ff in cDynamicModuleType::buildInside (this=0x1021e0ff0, module=0x1029e3240) at netbuilder/cdynamicmoduletype.cc:87
#16 0x0000000100aba887 in cCompoundModule::doBuildInside (this=0x1029e3240) at ccompoundmodule.cc:50
#17 0x0000000100aec16c in cModule::buildInside (this=0x1029e3240) at cmodule.cc:1086
#18 0x00000001002d5e99 in TraCIScenarioManager::addModule (this=0x1022036c0, nodeId={static npos = <optimized out>, _M_dataplus = {<allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x1029e3188 "SouthPemMorn-263"}}, type={static npos = <optimized out>, _M_dataplus = {<allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x102205cc8 "org.mixim.examples.veins.Car"}}, name={static npos = <optimized out>, _M_dataplus = {<allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x102205b78 "node"}}, displayString={static npos = <optimized out>, _M_dataplus = {<allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x102205c48 ""}}, position=@0x7fff5fbfece0, road_id={static npos = <optimized out>, _M_dataplus = {<allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x1029e3228 "54662542"}}, speed=0, angle=0.62275777427346168) at mobility/traci/TraCIScenarioManager.cc:657
#19 0x00000001002d99c6 in TraCIScenarioManager::processVehicleSubscription (this=0x1022036c0, objectId={static npos = <optimized out>, _M_dataplus = {<allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x1029e3188 "SouthPemMorn-263"}}, buf=@0x7fff5fbff000) at mobility/traci/TraCIScenarioManager.cc:1168
#20 0x00000001002d9e5f in TraCIScenarioManager::processSubcriptionResult (this=0x1022036c0, buf=@0x7fff5fbff000) at mobility/traci/TraCIScenarioManager.cc:1189
#21 0x00000001002d7c59 in TraCIScenarioManager::subscribeToVehicleVariables (this=0x1022036c0, vehicleId={static npos = <optimized out>, _M_dataplus = {<allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x1029ea1c8 "SouthPemMorn-263"}}) at mobility/traci/TraCIScenarioManager.cc:942
#22 0x00000001002d8fe6 in TraCIScenarioManager::processVehicleSubscription (this=0x1022036c0, objectId={static npos = <optimized out>, _M_dataplus = {<allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x100f33838 ""}}, buf=@0x7fff5fbff480) at mobility/traci/TraCIScenarioManager.cc:1093
#23 0x00000001002d9e5f in TraCIScenarioManager::processSubcriptionResult (this=0x1022036c0, buf=@0x7fff5fbff480) at mobility/traci/TraCIScenarioManager.cc:1189
#24 0x00000001002d681b in TraCIScenarioManager::executeOneTimestep (this=0x1022036c0) at mobility/traci/TraCIScenarioManager.cc:732
#25 0x00000001002d35a5 in TraCIScenarioManager::handleSelfMsg (this=0x1022036c0, msg=0x102214090) at mobility/traci/TraCIScenarioManager.cc:392
#26 0x00000001002d3524 in TraCIScenarioManager::handleMessage (this=0x1022036c0, msg=0x102214090) at mobility/traci/TraCIScenarioManager.cc:379
#27 0x0000000100b10baf in cSimulation::doOneEvent (this=0x101546b40, mod=0x1022036c0) at csimulation.cc:648
#28 0x0000000100a88c21 in Cmdenv::simulate (this=0x1015468a0) at cmdenv.cc:408
#29 0x0000000100a88651 in Cmdenv::run (this=0x1015468a0) at cmdenv.cc:275
#30 0x00000001007a36e9 in EnvirBase::run (this=0x1015468a0, argc=4, argv=0x7fff5fbff9e8, configobject=0x10153b880) at envirbase.cc:245
#31 0x00000001007a065f in setupUserInterface (argc=4, argv=0x7fff5fbff9e8) at startup.cc:235
#32 0x00000001007a161b in evMain (argc=4, argv=0x7fff5fbff9e8) at evmain.cc:37
#33 0x0000000100001856 in main (argc=4, argv=0x7fff5fbff9e8) at main.cc:27
(gdb) Quit

Dave Mck

unread,
May 19, 2013, 1:31:37 PM5/19/13
to omn...@googlegroups.com
Can anybody offer any insight? I worked all day today to try and figure out what exactly was causing the error, but had no success.

As far as I can tell, during the initialization of the vehicle, the analogue parameters for the physical layer is read from a file config.xml (as well is the configuration for the decider). The error seems to happen when parsing this XML data.

Two questions then are:

1. Why does this work without problem in the IDE but cause an exception in console? Is Cmdenv different from the IDE somehow?
2. Why does this run without error for some amount of time and then cause an error on a specific vehicle? The config.xml file doesn't change, so if I am no mistaken, the parsing should work the same for each vehicle...

Thanks for any help/info/ideas/direction/etc. as I really have no idea how to fix the problem at this point.

-Dave

Christoph Sommer

unread,
May 20, 2013, 2:12:50 PM5/20/13
to omn...@googlegroups.com
Dear Dave,

Dave Mck wrote:
> It runs successfully for a certain amount of time but crashes at the creation of vehicle id 248 with the following error:
> <!> Error in module (PhyLayer80211p) myscenario.node[248].nic.phy80211p (id=1755) at event #524057, t=186: Error evaluating parameter `analogueModels': basic_string::_S_construct null not valid.
[...]
> As far as I can tell, during the initialization of the vehicle, the
> analogue parameters for the physical layer is read from a file
> config.xml (as well is the configuration for the decider). The error
> seems to happen when parsing this XML data.

it seems like the error is hidden (during parsing, something might
returns NULL instead of throwing an exception). Can you pinpoint where
this happens?

Could it be an out of memory error?

Do short test runs with valgrind and/or efence come back clean?


Best,

Christoph

--
Dr.-Ing. Christoph Sommer
Institute of Computer Science
University of Innsbruck, Austria
Phone: +43 512 507-53285 / Fax: -53079
http://ccs.uibk.ac.at/~sommer/

Dave Mck

unread,
May 23, 2013, 11:51:31 AM5/23/13
to omn...@googlegroups.com
Thanks for the reply, I had never used valgrind before but now have 3 days of experience :D

There were some errors related to my programming (coming from Java/Python there are many mistakes I was making) but these were not the cause of the problem. I was opening files for various vehicles in the simulation to write some data. The problem is that the terminal on Mac has a very small limit on the number of open files (256 by default), which is why the simulation would run fine within the IDE (using the system maximum for open files) but crash in the terminal. Once the terminal reached the maximum number of files, I assume it returned null for a file opened to read in the XML config and caused the crash.

For anybody with a similar problem, ulimit -n shows you the maximum number of files you can open in terminal and ulimit -n xxxx will change the maximum files to xxxx.

Again, thank you Cristoph for the information that eventually led me to an answer.
Reply all
Reply to author
Forward
0 new messages