Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

person getStage(id, -1) crashes sumo #7336

Closed
atellyro opened this issue Jul 23, 2020 · 2 comments
Closed

person getStage(id, -1) crashes sumo #7336

atellyro opened this issue Jul 23, 2020 · 2 comments
Assignees

Comments

@atellyro
Copy link
Contributor

Running the scenario of Dillip you get for some persons this stack trace
SumoCrash.tar.gz

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00005555562a14de in MSStageDriving::getDistance (this=0x5555584dd930) at /dosd/src/opensource/Sumo/sumo-git-co/sumo/src/microsim/transportables/MSStageDriving.cpp:134
#2 0x00005555560582b9 in libsumo::Person::getStage (personID="2364", nextStageIndex=-1) at /dosd/src/opensource/Sumo/sumo-git-co/sumo/src/libsumo/Person.cpp:234
#3 0x0000555555ff2379 in TraCIServerAPI_Person::processGet (server=..., inputStorage=..., outputStorage=...) at /dosd/src/opensource/Sumo/sumo-git-co/sumo/src/traci-server/TraCIServerAPI_Person.cpp:63
#4 0x0000555555fdbe6e in TraCIServer::dispatchCommand (this=0x5555569247a0) at /dosd/src/opensource/Sumo/sumo-git-co/sumo/src/traci-server/TraCIServer.cpp:752
#5 0x0000555555fdb3b7 in TraCIServer::processCommandsUntilSimStep (this=0x5555569247a0, step=1935000) at /dosd/src/opensource/Sumo/sumo-git-co/sumo/src/traci-server/TraCIServer.cpp:602
#6 0x0000555555e21756 in MSNet::simulationStep (this=0x555556939660) at /dosd/src/opensource/Sumo/sumo-git-co/sumo/src/microsim/MSNet.cpp:524
#7 0x0000555555e1f08b in MSNet::simulate (this=0x555556939660, start=0, stop=36000000) at /dosd/src/opensource/Sumo/sumo-git-co/sumo/src/microsim/MSNet.cpp:355
#8 0x0000555555e1c29c in main (argc=2, argv=0x7fffffffdb98) at /dosd/src/opensource/Sumo/sumo-git-co/sumo/src/sumo_main.cpp:107
(gdb) up
#1 0x00005555562a14de in MSStageDriving::getDistance (this=0x5555584dd930) at /dosd/src/opensource/Sumo/sumo-git-co/sumo/src/microsim/transportables/MSStageDriving.cpp:134
134 return myVehicle->getOdometer() - myVehicleDistance;
(gdb) p *myVehicle
$1 = { = { = {_vptr.Named = 0x555557eba000, myID = " \347\036XUU\000"}, }, }

@atellyro
Copy link
Contributor Author

If you run sumoD with valgrind (under Linux) you get this info

==132033== Invalid read of size 8
==132033== at 0xE554CC: MSStageDriving::getDistance() const (MSStageDriving.cpp:134)
==132033== by 0xC0C2B8: libsumo::Person::getStage(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int) (Person.cpp:234)
==132033== by 0xBA6378: TraCIServerAPI_Person::processGet(TraCIServer&, tcpip::Storage&, tcpip::Storage&) (TraCIServerAPI_Person.cpp:63)
==132033== by 0xB8FE6D: TraCIServer::dispatchCommand() (TraCIServer.cpp:752)
==132033== by 0xB8F3B6: TraCIServer::processCommandsUntilSimStep(long long) (TraCIServer.cpp:602)
==132033== by 0x9D5755: MSNet::simulationStep() (MSNet.cpp:524)
==132033== by 0x9D308A: MSNet::simulate(long long, long long) (MSNet.cpp:355)
==132033== by 0x9D029B: main (sumo_main.cpp:107)
==132033== Address 0x98ed580 is 0 bytes inside a block of size 784 free'd
==132033== at 0x483CFBF: operator delete(void*) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==132033== by 0xA6853D: MSVehicle::~MSVehicle() (MSVehicle.cpp:1042)
==132033== by 0xAB46B2: MSVehicleControl::deleteVehicle(SUMOVehicle*, bool) (MSVehicleControl.cpp:314)
==132033== by 0xAB3775: MSVehicleControl::removePending() (MSVehicleControl.cpp:166)
==132033== by 0xAFDEE5: MSEdgeControl::executeMovements(long long) (MSEdgeControl.cpp:199)
==132033== by 0x9D5B53: MSNet::simulationStep() (MSNet.cpp:579)
==132033== by 0x9D308A: MSNet::simulate(long long, long long) (MSNet.cpp:355)
==132033== by 0x9D029B: main (sumo_main.cpp:107)
==132033== Block was alloc'd at
==132033== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==132033== by 0xAB3093: MSVehicleControl::buildVehicle(SUMOVehicleParameter*, MSRoute const*, MSVehicleType*, bool, bool) (MSVehicleControl.cpp:106)
==132033== by 0xB0E361: MSInsertionControl::determineCandidates(long long) (MSInsertionControl.cpp:221)
==132033== by 0x9D5CCE: MSNet::simulationStep() (MSNet.cpp:602)
==132033== by 0x9D308A: MSNet::simulate(long long, long long) (MSNet.cpp:355)
==132033== by 0x9D029B: main (sumo_main.cpp:107)
==132033==
==132033==
==132033== Process terminating with default action of signal 11 (SIGSEGV)
==132033== Bad permissions for mapped region at address 0x1427B48
==132033== at 0x1427B48: ??? (in /dosd/src/opensource/Sumo/sumo-git-co/sumo/bin/sumoD)
==132033== by 0xC0C2B8: libsumo::Person::getStage(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int) (Person.cpp:234)
==132033== by 0xBA6378: TraCIServerAPI_Person::processGet(TraCIServer&, tcpip::Storage&, tcpip::Storage&) (TraCIServerAPI_Person.cpp:63)
==132033== by 0xB8FE6D: TraCIServer::dispatchCommand() (TraCIServer.cpp:752)
==132033== by 0xB8F3B6: TraCIServer::processCommandsUntilSimStep(long long) (TraCIServer.cpp:602)
==132033== by 0x9D5755: MSNet::simulationStep() (MSNet.cpp:524)
==132033== by 0x9D308A: MSNet::simulate(long long, long long) (MSNet.cpp:355)
==132033== by 0x9D029B: main (sumo_main.cpp:107)
==132033==

I think the programm tries to comute the distance to a vehicle, which is deleted.

@atellyro
Copy link
Contributor Author

To reproduce the error on Linux run the script demi-i_hs.py with the option --gdb and start parallel a sumoD with gdb or valgrind
The problem occurs after some minutes run frist with person 2209, than with bperson 2364

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants