Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-26 Thread marcelreppi
Hello Jakob,

I can confirm that this has fixed my crashing issue!
That's just amazing!
Thank you so much for your incredible support! 
I really appreciate it!

Best regards
Marcel





--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-26 Thread Jakob Erdmann
Today's version already includes the crash fix. The other issue is fixed on
github now (https://github.com/eclipse/sumo/issues/7075) and you can
download the updated version tomorrow.

Am Di., 26. Mai 2020 um 11:41 Uhr schrieb marcelreppi :

> Hello Jakob,
>
> thank you so much for looking into it and fixing it so quickly!
> Will the next nightly build include the fix?
>
> I have tested your suggestion.
> In my tests changing the period value worked but the change only seems to
> take effect after the first rerouting with the initial value.
>
> I started the simulation again with
>
> 
> 
> 
> 
>
> in my simulation config file.
> Then I rerouted the vehicle with TraCI at insertion and immediately
> executed
> this:
>
> traci.vehicle.setParameter(vid, "device.rerouting.period", "10")
>
> Here is an example of my vehroute-output (I removed some unrelated
> attributes):
>
> 
>   
>   
>   
>   
>   
>   
>   
> 
>
> It seems that there is still something wrong because I would expect the
> change in rerouting period to take effect immediately.
>
> Thanks a lot!
>
> Best regards
> Marcel
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-23 Thread marcelreppi
I have experimented some more with my code to find the issue.
I feel like I have found the problem but I am not 100% sure.

My SUMO config has the following parameters at the start of the simulation:

*


*

During the simulation I am trying to "turn off" the rerouting device for
some vehicles so I used the following TraCI function:

*traci.vehicle.setParameter(vid, "device.rerouting.period", "0")*

It seems that setting it to 0 somehow causes the unexpected error.
When I changed it to

*traci.vehicle.setParameter(vid, "device.rerouting.period", "9")*

everything seems to be working fine but the desired behavior (prevent
dynamic rerouting for specific vehicles) is not happening anymore! 
It seems that setting "device.rerouting.period" to a different value has no
effect because I can see in the "vehroute-output" that vehicles are still
being rerouting by the device with the initial period value.

Here is an example:

This is a snippet of my code for rerouting:

*# Do some travel time adaptation to some edges
...
traci.vehicle.rerouteTraveltime(vid, False)
# Disable rerouting through the rerouting device so that vehicle will stay
on this route
traci.vehicle.setParameter(vid, "device.rerouting.period", "9")*

In the "vehroute-output" I still see the following (note the attributes
"reason" and "replacedAtTime"):

*





*

I thought this would work based on the documentation I read here:
https://sumo.dlr.de/docs/Demand/Automatic_Routing.html#traci

Is there a different/recommended way for disabling periodic rerouting for
specific vehicles?

Thank you very much!

Best regards
Marcel



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-20 Thread marcelreppi
I have put together a small scenario.
Please find some further information in the README.

The scenario was too big to attach here so I uploaded it to my cloud:

https://u.pcloud.link/publink/show?code=XZEAYqkZhi7JpWGDfpSA3xJiW5uCtuSork4k

Thank you very much for looking into it!!
I am eagerly waiting, if there is anything you can find.




--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-20 Thread marcelreppi
I will try to create a portable scenario that is as small as possible and
post it here.

It must be related to TraCI rerouting, because as soon as I turn it off it
seems to be running fine.

Thank you very much!




--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-20 Thread marcelreppi
I was able to recreate the other error. Here is the stacktrace:

Step #900.00 (8ms ~= 125.00*RT, ~1000.00UPS, TraCI: 5ms, vehicles TOT
Step #1000.00 (3ms ~= 333.33*RT, ~2333.33UPS, TraCI: 5ms, vehicles TO
Step #1100.00 (2ms ~= 5corrupted size vs. prev_size

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6)
at ../sysdeps/unix/sysv/linux/raise.c:50
50  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6)
at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x7e805859 in __GI_abort () at abort.c:79
#2  0x7e8703ee in __libc_message (
action=action@entry=do_abort, 
fmt=fmt@entry=0x7e99a285 "%s\n")
at ../sysdeps/posix/libc_fatal.c:155
#3  0x7e87847c in malloc_printerr (
str=str@entry=0x7e99843a "corrupted size vs. prev_size")
at malloc.c:5347
#4  0x7e878aeb in unlink_chunk (p=p@entry=0xd5bd290, 
av=0x7e9cbb80 ) at malloc.c:1454
#5  0x7e87b773 in _int_malloc (
av=av@entry=0x7e9cbb80 , bytes=bytes@entry=8)
at malloc.c:4041
#6  0x7e87d2d4 in __GI___libc_malloc (bytes=8)
at malloc.c:3058
#7  0x7ec0ac29 in operator new(unsigned long) ()
   from /lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x088655dc in __gnu_cxx::new_allocator::allocate
(this=0xd5bc588, __n=1)
at /usr/include/c++/9/ext/new_allocator.h:114
#9  0x08861f78 in std::allocator_traits
>::allocate (__a=..., __n=1)
at /usr/include/c++/9/bits/alloc_traits.h:444
#10 0x0885b736 in std::_Vector_base >::_M_allocate (this=0xd5bc588, __n=1)

Thank you!



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-20 Thread Jakob Erdmann
Thanks for the backtrace
Unfortunately, it was not enough for me to pinpoint the source of the error
(even though it points at the rough area).
I will need to replicate the crash on my own machine and would need a
suitable scenario (including traci script) for this. The smaller you can
make it, the better.
Here is a wild guess though: Are you using multiple threads to run sumo
(--threads or --device.rerouting.threads)? In that case, try without these
options and see if that fixes the crash.

regards,
Jakob

Am Mi., 20. Mai 2020 um 13:31 Uhr schrieb marcelreppi :

> Unfortunately I had already closed that terminal.
> I tried running it again but I could not get the exact same error. I will
> try to recreate it.
>
> I got a different error though. Here is the stacktrace for it:
>
> Warning: At actuated tlLogic 'joinedS_7', linkIndex 16 has no controlling
> detector
> Step #1600.00 (4ms ~= 250.00*RT, ~1750.00UPS, TraCI: 4ms, vehicles TOT 26
> ACT 7 BUF 0)
> Program received signal SIGSEGV, Segmentation fault.
> MSVehicleDevice::getNumericalID (this=0xd4dad01) at
> /home/mazel/sumo-1.6.0/src/microsim/devices/MSVehicleDevice.h:77
> 77  return myHolder.getNumericalID();
> (gdb) bt
> #0  MSVehicleDevice::getNumericalID (this=0xd4dad01) at
> /home/mazel/sumo-1.6.0/src/microsim/devices/MSVehicleDevice.h:77
> #1  0x08afcd0e in
> ComparatorNumericalIdLess::operator() (
> this=0x9133220 , a=0xd5b8730,
> b=0xd4dad01)
> at /home/mazel/sumo-1.6.0/src/utils/common/Named.h:41
> #2  0x08afc3bc in std::_Rb_tree MSDevice_Tripinfo const*, std::_IdentityMSDevice_Tripinfo const*>,
> ComparatorNumericalIdLess, std::allocator
> >::_M_get_insert_unique_pos (
> this=0x9133220 ,
> __k=@0x7ffed1f8: 0xd5b8730)
> at /usr/include/c++/9/bits/stl_tree.h:2095
> #3  0x08afba9a in std::_Rb_tree MSDevice_Tripinfo const*, std::_IdentityMSDevice_Tripinfo const*>,
> ComparatorNumericalIdLess, std::allocator
> >::_M_insert_unique (
> this=0x9133220 ,
> __v=@0x7ffed1f8: 0xd5b8730)
> at /usr/include/c++/9/bits/stl_tree.h:2147
> #4  0x08afb627 in std::set ComparatorNumericalIdLess, std::allocator
> >::insert (this=0x9133220 ,
> __x=@0x7ffed1f8: 0xd5b8730)
> at /usr/include/c++/9/bits/stl_set.h:520
> #5  0x08af5de2 in MSDevice_Tripinfo::buildVehicleDevices (v=...,
> into=std::vector of length 2, capacity 2 = {...})
> at /home/mazel/sumo-1.6.0/src/microsim/devices/MSDevice_Tripinfo.cpp:89
> #6  0x08a9908b in MSDevice::buildVehicleDevices (v=...,
> into=std::vector of length 2, capacity 2 = {...})
> at /home/mazel/sumo-1.6.0/src/microsim/devices/MSDevice.cpp:100
> #7  0x08896715 in MSBaseVehicle::initDevices (this=0xd4daf60) at
> /home/mazel/sumo-1.6.0/src/microsim/MSBaseVehicle.cpp:153
> #8  0x08828994 in MSVehicle::initDevices (this=0xd4daf60) at
> /home/mazel/sumo-1.6.0/src/microsim/MSVehicle.cpp:1060
> #9  0x08870647 in MSVehicleControl::initVehicle (this=0x922e7e0,
> built=0xd4daf60, ignoreStopErrors=false)
> at /home/mazel/sumo-1.6.0/src/microsim/MSVehicleControl.cpp:123
> #10 0x088705ca in MSVehicleControl::buildVehicle (this=0x922e7e0,
> defs=0xd4eb3f0, route=0x9284c50, type=0x922e0f0,
> ignoreStopErrors=false, fromRouteFile=true) at
> /home/mazel/sumo-1.6.0/src/microsim/MSVehicleControl.cpp:114
> #11 0x089308b0 in MSRouteHandler::closeVehicle (this=0xc58ace0)
> at /home/mazel/sumo-1.6.0/src/microsim/MSRouteHandler.cpp:727
> #12 0x08933207 in MSRouteHandler::closeTrip (this=0xc58ace0) at
> /home/mazel/sumo-1.6.0/src/microsim/MSRouteHandler.cpp:980
> #13 0x08d0f062 in SUMORouteHandler::myEndElement (this=0xc58ace0,
> element=55)
> at /home/mazel/sumo-1.6.0/src/utils/vehicle/SUMORouteHandler.cpp:266
> #14 0x08d5d3c1 in GenericSAXHandler::endElement (this=0xc58ace0,
> qname=0xcd792f0 u"trip")
> at /home/mazel/sumo-1.6.0/src/utils/xml/GenericSAXHandler.cpp:154
>
> Thanks!
>
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-20 Thread marcelreppi
Unfortunately I had already closed that terminal.
I tried running it again but I could not get the exact same error. I will
try to recreate it.

I got a different error though. Here is the stacktrace for it:

Warning: At actuated tlLogic 'joinedS_7', linkIndex 16 has no controlling
detector
Step #1600.00 (4ms ~= 250.00*RT, ~1750.00UPS, TraCI: 4ms, vehicles TOT 26
ACT 7 BUF 0)
Program received signal SIGSEGV, Segmentation fault.
MSVehicleDevice::getNumericalID (this=0xd4dad01) at
/home/mazel/sumo-1.6.0/src/microsim/devices/MSVehicleDevice.h:77
77  return myHolder.getNumericalID();
(gdb) bt
#0  MSVehicleDevice::getNumericalID (this=0xd4dad01) at
/home/mazel/sumo-1.6.0/src/microsim/devices/MSVehicleDevice.h:77
#1  0x08afcd0e in
ComparatorNumericalIdLess::operator() (
this=0x9133220 , a=0xd5b8730,
b=0xd4dad01)
at /home/mazel/sumo-1.6.0/src/utils/common/Named.h:41
#2  0x08afc3bc in std::_Rb_tree,
ComparatorNumericalIdLess, std::allocator
>::_M_get_insert_unique_pos (
this=0x9133220 ,
__k=@0x7ffed1f8: 0xd5b8730)
at /usr/include/c++/9/bits/stl_tree.h:2095
#3  0x08afba9a in std::_Rb_tree,
ComparatorNumericalIdLess, std::allocator
>::_M_insert_unique (
this=0x9133220 ,
__v=@0x7ffed1f8: 0xd5b8730)
at /usr/include/c++/9/bits/stl_tree.h:2147
#4  0x08afb627 in std::set
>::insert (this=0x9133220 ,
__x=@0x7ffed1f8: 0xd5b8730)
at /usr/include/c++/9/bits/stl_set.h:520
#5  0x08af5de2 in MSDevice_Tripinfo::buildVehicleDevices (v=...,
into=std::vector of length 2, capacity 2 = {...})
at /home/mazel/sumo-1.6.0/src/microsim/devices/MSDevice_Tripinfo.cpp:89
#6  0x08a9908b in MSDevice::buildVehicleDevices (v=...,
into=std::vector of length 2, capacity 2 = {...})
at /home/mazel/sumo-1.6.0/src/microsim/devices/MSDevice.cpp:100
#7  0x08896715 in MSBaseVehicle::initDevices (this=0xd4daf60) at
/home/mazel/sumo-1.6.0/src/microsim/MSBaseVehicle.cpp:153
#8  0x08828994 in MSVehicle::initDevices (this=0xd4daf60) at
/home/mazel/sumo-1.6.0/src/microsim/MSVehicle.cpp:1060
#9  0x08870647 in MSVehicleControl::initVehicle (this=0x922e7e0,
built=0xd4daf60, ignoreStopErrors=false)
at /home/mazel/sumo-1.6.0/src/microsim/MSVehicleControl.cpp:123
#10 0x088705ca in MSVehicleControl::buildVehicle (this=0x922e7e0,
defs=0xd4eb3f0, route=0x9284c50, type=0x922e0f0,
ignoreStopErrors=false, fromRouteFile=true) at
/home/mazel/sumo-1.6.0/src/microsim/MSVehicleControl.cpp:114
#11 0x089308b0 in MSRouteHandler::closeVehicle (this=0xc58ace0)
at /home/mazel/sumo-1.6.0/src/microsim/MSRouteHandler.cpp:727
#12 0x08933207 in MSRouteHandler::closeTrip (this=0xc58ace0) at
/home/mazel/sumo-1.6.0/src/microsim/MSRouteHandler.cpp:980
#13 0x08d0f062 in SUMORouteHandler::myEndElement (this=0xc58ace0,
element=55)
at /home/mazel/sumo-1.6.0/src/utils/vehicle/SUMORouteHandler.cpp:266
#14 0x08d5d3c1 in GenericSAXHandler::endElement (this=0xc58ace0,
qname=0xcd792f0 u"trip")
at /home/mazel/sumo-1.6.0/src/utils/xml/GenericSAXHandler.cpp:154

Thanks!




--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-20 Thread Jakob Erdmann
After the crash while still in gdb, create a backtrace by typing
'bt' 'enter'
and then post the output.

Am Mi., 20. Mai 2020 um 13:20 Uhr schrieb marcelreppi :

> That worked!
>
> Thank you very very much for replying so quick and helping!
> I really appreciate it!!
>
> It crashed giving me the following error:
>
> Step #3000.00 (6ms ~= 166.67*RT, ~833.33UPS, TraCI: 6ms, vehicles TOT 50
> ACT
> 5 BUFStep #3100.00 (2ms ~= 500.00*RT, ~2000.00UPS, TraCI: 5ms, vehicles TOT
> 51 ACT 4 BUStep #3200.00 (3ms ~= 333.33*RT, ~1666.67UPS, TraCI: 4ms,
> vehicles TOT 53 ACT 5 BUStep #3300.00 (4ms ~= 250.00*RT, ~1750.00UPS,
> TraCI:
> 5ms, vehicles TOcorrupted size vs. prev_size
>
> Program received signal SIGABRT, Aborted.
> __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
> 50  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
>
> Best regards
> Marcel
>
>
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-20 Thread marcelreppi
That worked!

Thank you very very much for replying so quick and helping! 
I really appreciate it!!

It crashed giving me the following error:

Step #3000.00 (6ms ~= 166.67*RT, ~833.33UPS, TraCI: 6ms, vehicles TOT 50 ACT
5 BUFStep #3100.00 (2ms ~= 500.00*RT, ~2000.00UPS, TraCI: 5ms, vehicles TOT
51 ACT 4 BUStep #3200.00 (3ms ~= 333.33*RT, ~1666.67UPS, TraCI: 4ms,
vehicles TOT 53 ACT 5 BUStep #3300.00 (4ms ~= 250.00*RT, ~1750.00UPS, TraCI:
5ms, vehicles TOcorrupted size vs. prev_size

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.

Best regards
Marcel





--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-20 Thread Jakob Erdmann
After starting gdb you have to press 'r' followers by 'enter' to make sumo
run and open up the port.

Am Mi., 20. Mai 2020 um 12:42 Uhr schrieb marcelreppi :

> I thought so and that's also exactly what I did.
> The numRetries=100 is helpful, thanks!
>
> It's constantly trying to connect to a different port and re-writing the
> debug.sumocfg. Even after I executed the gdb command.
> I can see the following warning/error
>
> /home/mazel/sumo-1.6.0/tools/traci/main.py:136: UserWarning: Could not
> connect to TraCI server using port 59061. Retrying with different port.
>   warnings.warn("Could not connect to TraCI server using port %s. Retrying
> with different port." % sumoPort)
>
> Nothing is happening except TraCI reconnecting to many different ports
> until
> it eventually crashes with
>
> Traceback (most recent call last):
>   File "/home/mazel/master-thesis-code/sumo/traci/index.py", line 65, in
> 
> controller.start()
>   File
> "/home/mazel/master-thesis-code/sumo/traci/simulation_controller.py",
> line 27, in start
> traci.start(self.traci_config["sumo_cmd"], numRetries=100)
>   File "/home/mazel/sumo-1.6.0/tools/traci/main.py", line 132, in start
> return init(sumoPort, numRetries, "localhost", label, sumoProcess)
>   File "/home/mazel/sumo-1.6.0/tools/traci/main.py", line 113, in init
> _connections[label] = connect(port, numRetries, host, proc)
>   File "/home/mazel/sumo-1.6.0/tools/traci/main.py", line 104, in connect
> raise FatalTraCIError("Could not connect in %s tries" % (numRetries +
> 1))
> traci.exceptions.FatalTraCIError: Could not connect in 1 tries
>
> I am not sure what to do...
>
> Thank you very much!!!
>
> Best regards
> Marcel
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-20 Thread marcelreppi
I thought so and that's also exactly what I did.
The numRetries=100 is helpful, thanks!

It's constantly trying to connect to a different port and re-writing the
debug.sumocfg. Even after I executed the gdb command.
I can see the following warning/error

/home/mazel/sumo-1.6.0/tools/traci/main.py:136: UserWarning: Could not
connect to TraCI server using port 59061. Retrying with different port.
  warnings.warn("Could not connect to TraCI server using port %s. Retrying
with different port." % sumoPort)

Nothing is happening except TraCI reconnecting to many different ports until
it eventually crashes with

Traceback (most recent call last):
  File "/home/mazel/master-thesis-code/sumo/traci/index.py", line 65, in

controller.start()
  File "/home/mazel/master-thesis-code/sumo/traci/simulation_controller.py",
line 27, in start
traci.start(self.traci_config["sumo_cmd"], numRetries=100)
  File "/home/mazel/sumo-1.6.0/tools/traci/main.py", line 132, in start
return init(sumoPort, numRetries, "localhost", label, sumoProcess)
  File "/home/mazel/sumo-1.6.0/tools/traci/main.py", line 113, in init
_connections[label] = connect(port, numRetries, host, proc)
  File "/home/mazel/sumo-1.6.0/tools/traci/main.py", line 104, in connect
raise FatalTraCIError("Could not connect in %s tries" % (numRetries +
1))
traci.exceptions.FatalTraCIError: Could not connect in 1 tries

I am not sure what to do...

Thank you very much!!!

Best regards
Marcel



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-20 Thread Jakob Erdmann
The build is ok (the enabled features are sufficient for your needs).

To make the debugging work you need to start the traci script in one shell
and start the debugger in another shell while the script still tries to
reconnect. You either have to be quick for this or set a higher number of
retries (traci.start(numRetries=100, ...).

Am Mi., 20. Mai 2020 um 12:02 Uhr schrieb marcelreppi :

> I followed the build instructions here
>
> https://sumo.dlr.de/docs/Installing/Linux_Build.html#building_the_sumo_binaries_with_cmake_recommended
>
> I am doing all of this in WSL Ubuntu.
> When executing "cmake -D CMAKE_BUILD_TYPE=Debug ../.." I got the following
> output:
> *
> -- CMAKE_BINARY_DIR: /home/mazel/sumo-1.6.0/build/cmake-build
> -- CMAKE_SOURCE_DIR: /home/mazel/sumo-1.6.0
> --
> -- Platform:
> -- Host: Linux-4.4.0-18362-Microsoft x86_64
> -- Target: Linux-4.4.0-18362-Microsoft x86_64
> -- CMake: 3.16.3
> -- CMake generator: Unix Makefiles
> -- CMake build tool: /usr/bin/make
> -- Compiler: GNU 9.3.0
> --
> -- Found Python: /usr/bin/python
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named setuptools
> -- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR
> GTEST_MAIN_LIBRARY)
> -- Found Proj: /usr/lib/x86_64-linux-gnu/libproj.so
> -- Found Fox: -L/usr/lib/x86_64-linux-gnu -lFOX-1.6 -lX11 -lXext -lfreetype
> -lfontconfig -lXft -lXcursor -lfreetype -lfontconfig -lfreetype -lGL -lGLU
> -ldl -lpthread -lrt -ljpeg -lpng -ltiff -lz -lGLU -lGL
> -- Could NOT find suitable FFmpeg.
> -- Could NOT find osgGA (missing: OSGGA_LIBRARY OSGGA_INCLUDE_DIR)
> -- Could NOT find osgViewer (missing: OSGVIEWER_LIBRARY
> OSGVIEWER_INCLUDE_DIR)
> -- Could NOT find osgUtil (missing: OSGUTIL_LIBRARY OSGUTIL_INCLUDE_DIR)
> -- Could NOT find osgDB (missing: OSGDB_LIBRARY OSGDB_INCLUDE_DIR)
> -- Could NOT find osgText (missing: OSGTEXT_LIBRARY OSGTEXT_INCLUDE_DIR)
> -- Could NOT find osg (missing: OSG_LIBRARY OSG_INCLUDE_DIR)
> -- Could NOT find OpenThreads (missing: OPENTHREADS_LIBRARY
> OPENTHREADS_INCLUDE_DIR)
> -- Could NOT find OpenSceneGraph (missing: OPENSCENEGRAPH_LIBRARIES
> OPENSCENEGRAPH_INCLUDE_DIR) (Required is at least version "3.4.0")
> -- Could NOT find Eigen3 (missing: EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
> (Required is at least version "3.2")
> -- Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAVAC_EXECUTABLE
> Java_JAR_EXECUTABLE Java_JAVADOC_EXECUTABLE Java_JAVAH_EXECUTABLE
> Development)
> -- Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE
> Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE)
> -- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY
> JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
> CMake Warning at src/libsumo/CMakeLists.txt:102 (message):
>   ENABLE_JAVA_BINDINGS is set but Java or JNI was not found.
>
>
> -- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES
> PYTHON_INCLUDE_DIRS)
> CMake Warning at src/libsumo/CMakeLists.txt:159 (message):
>   ENABLE_PYTHON_BINDINGS is set but Python libraries were not found.
>
>
> -- Enabled features: Linux-4.4.0-18362-Microsoft x86_64 GNU 9.3.0 Debug
> Proj
> GUI SWIG GDAL GL2PS
> -- Configuring done
> -- Generating done
> -- Build files have been written to:
> /home/mazel/sumo-1.6.0/build/cmake-build*
>
> I am not sure if the missing things are acceptable or not.
> The build worked with a lot of warnings but no errors.
> Afterwards I found the "sumoD" file in the "bin" directory.
>
> I followed the instructions in the link you sent but I can't get it to
> work.
> Nothing is happening.
> I am using this to start TraCI
>
> sumo_binary = os.environ["SUMO_HOME"] + "/bin/sumoD"
> args.sumo_config = path/to/my/config.sumocfg
>
> sumo_cmd = [
> sumo_binary,
> "--configuration-file",
> args.sumo_config,
> "--save-configuration",
> "debug.sumocfg",
> ]
>
> TraCI tries to reconnect many times and eventually fails.
>
> */home/mazel/sumo-1.6.0/tools/traci/main.py:136: UserWarning: Could not
> connect to TraCI server using port 58141. Retrying with different port.
>   warnings.warn("Could not connect to TraCI server using port %s. Retrying
> with different port." % sumoPort)
> Traceback (most recent call last):
>   File "/home/mazel/master-thesis-code/sumo/traci/index.py", line 66, in
> 
> controller.start()
>   File
> "/home/mazel/master-thesis-code/sumo/traci/simulation_controller.py",
> line 27, in start
> traci.start(self.traci_config["sumo_cmd"])
>   File "/home/mazel/sumo-1.6.0/tools/traci/main.py", line 132, in start
> return init(sumoPort, numRetries, "localhost", label, sumoProcess)
>   File "/home/mazel/sumo-1.6.0/tools/traci/main.py", line 113, in init
> _connections[label] = connect(port, numRetries, host, proc)
>   File "/home/mazel/sumo-1.6.0/tools/traci/main.py", line 104, in connect
> raise FatalTraCIError("Could not connect in %s tries" % (numRetries +
> 1))
> 

Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-20 Thread marcelreppi
I followed the build instructions here 
https://sumo.dlr.de/docs/Installing/Linux_Build.html#building_the_sumo_binaries_with_cmake_recommended

I am doing all of this in WSL Ubuntu.
When executing "cmake -D CMAKE_BUILD_TYPE=Debug ../.." I got the following
output:
*
-- CMAKE_BINARY_DIR: /home/mazel/sumo-1.6.0/build/cmake-build
-- CMAKE_SOURCE_DIR: /home/mazel/sumo-1.6.0
--
-- Platform:
-- Host: Linux-4.4.0-18362-Microsoft x86_64
-- Target: Linux-4.4.0-18362-Microsoft x86_64
-- CMake: 3.16.3
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Compiler: GNU 9.3.0
--
-- Found Python: /usr/bin/python
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named setuptools
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR
GTEST_MAIN_LIBRARY)
-- Found Proj: /usr/lib/x86_64-linux-gnu/libproj.so
-- Found Fox: -L/usr/lib/x86_64-linux-gnu -lFOX-1.6 -lX11 -lXext -lfreetype
-lfontconfig -lXft -lXcursor -lfreetype -lfontconfig -lfreetype -lGL -lGLU
-ldl -lpthread -lrt -ljpeg -lpng -ltiff -lz -lGLU -lGL
-- Could NOT find suitable FFmpeg.
-- Could NOT find osgGA (missing: OSGGA_LIBRARY OSGGA_INCLUDE_DIR)
-- Could NOT find osgViewer (missing: OSGVIEWER_LIBRARY
OSGVIEWER_INCLUDE_DIR)
-- Could NOT find osgUtil (missing: OSGUTIL_LIBRARY OSGUTIL_INCLUDE_DIR)
-- Could NOT find osgDB (missing: OSGDB_LIBRARY OSGDB_INCLUDE_DIR)
-- Could NOT find osgText (missing: OSGTEXT_LIBRARY OSGTEXT_INCLUDE_DIR)
-- Could NOT find osg (missing: OSG_LIBRARY OSG_INCLUDE_DIR)
-- Could NOT find OpenThreads (missing: OPENTHREADS_LIBRARY
OPENTHREADS_INCLUDE_DIR)
-- Could NOT find OpenSceneGraph (missing: OPENSCENEGRAPH_LIBRARIES
OPENSCENEGRAPH_INCLUDE_DIR) (Required is at least version "3.4.0")
-- Could NOT find Eigen3 (missing: EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
(Required is at least version "3.2")
-- Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAVAC_EXECUTABLE
Java_JAR_EXECUTABLE Java_JAVADOC_EXECUTABLE Java_JAVAH_EXECUTABLE
Development)
-- Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE
Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE)
-- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY
JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
CMake Warning at src/libsumo/CMakeLists.txt:102 (message):
  ENABLE_JAVA_BINDINGS is set but Java or JNI was not found.


-- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
CMake Warning at src/libsumo/CMakeLists.txt:159 (message):
  ENABLE_PYTHON_BINDINGS is set but Python libraries were not found.


-- Enabled features: Linux-4.4.0-18362-Microsoft x86_64 GNU 9.3.0 Debug Proj
GUI SWIG GDAL GL2PS
-- Configuring done
-- Generating done
-- Build files have been written to:
/home/mazel/sumo-1.6.0/build/cmake-build*

I am not sure if the missing things are acceptable or not.
The build worked with a lot of warnings but no errors.
Afterwards I found the "sumoD" file in the "bin" directory.

I followed the instructions in the link you sent but I can't get it to work.
Nothing is happening.
I am using this to start TraCI 

sumo_binary = os.environ["SUMO_HOME"] + "/bin/sumoD"
args.sumo_config = path/to/my/config.sumocfg

sumo_cmd = [
sumo_binary,
"--configuration-file",
args.sumo_config,
"--save-configuration",
"debug.sumocfg",
]

TraCI tries to reconnect many times and eventually fails.

*/home/mazel/sumo-1.6.0/tools/traci/main.py:136: UserWarning: Could not
connect to TraCI server using port 58141. Retrying with different port.
  warnings.warn("Could not connect to TraCI server using port %s. Retrying
with different port." % sumoPort)
Traceback (most recent call last):
  File "/home/mazel/master-thesis-code/sumo/traci/index.py", line 66, in

controller.start()
  File "/home/mazel/master-thesis-code/sumo/traci/simulation_controller.py",
line 27, in start
traci.start(self.traci_config["sumo_cmd"])
  File "/home/mazel/sumo-1.6.0/tools/traci/main.py", line 132, in start
return init(sumoPort, numRetries, "localhost", label, sumoProcess)
  File "/home/mazel/sumo-1.6.0/tools/traci/main.py", line 113, in init
_connections[label] = connect(port, numRetries, host, proc)
  File "/home/mazel/sumo-1.6.0/tools/traci/main.py", line 104, in connect
raise FatalTraCIError("Could not connect in %s tries" % (numRetries +
1))
traci.exceptions.FatalTraCIError: Could not connect in 1 tries*

When I execute the gdb command nothing happens

*gdb --args sumo-1.6.0/bin/sumoD -c
master-thesis-code/simulation/debug.sumocfg 

Reading symbols from sumo-1.6.0/bin/sumoD...
(gdb) *

What am I doing wrong?

I will also try and find a small scenario that crashes reliably.
Thanks a lot!!

Best regards
Marcel


Jakob Erdmann wrote
> No. The next step would be to run sumo in a debugger and the connecting
> your traci script.
> (see
> 

Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-19 Thread Jakob Erdmann
No. The next step would be to run sumo in a debugger and the connecting
your traci script.
(see
https://sumo.dlr.de/docs/TraCI/Interfacing_TraCI_from_Python.html#debugging_a_traci_session_on_linux
)
If you can manage to put together a small scenario that crashes "reliably"
(i.e after running it a few time for no more than a few minutes) and send
it to me, I would also take a look.


Am Di., 19. Mai 2020 um 15:39 Uhr schrieb marcelreppi :

> No not really... only about 180MB.
>
> When I try to change the arrival times or the amount of trips it affects
> the
> error.
> Sometimes it doesn't occur at all, sometimes earlier, sometimes later.
>
> What also happens very often is that TraCI crashes only saying
> "traci.exceptions.FatalTraCIError: connection closed by SUMO".
> In the past sometimes I was able to fix it by making sure objects are being
> unsubscribed from before removing them from the simulation but right now I
> really don't understand what is happening.
> Is there any way to get more detailed TraCI logs?
>
> Thanks a lot!
>
> Best regards
> Marcel
>
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-19 Thread marcelreppi
No not really... only about 180MB.

When I try to change the arrival times or the amount of trips it affects the
error. 
Sometimes it doesn't occur at all, sometimes earlier, sometimes later.

What also happens very often is that TraCI crashes only saying
"traci.exceptions.FatalTraCIError: connection closed by SUMO".
In the past sometimes I was able to fix it by making sure objects are being
unsubscribed from before removing them from the simulation but right now I
really don't understand what is happening.
Is there any way to get more detailed TraCI logs?

Thanks a lot!

Best regards
Marcel




--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] TraCI quits on "Error: bad allocation"

2020-05-19 Thread Jakob Erdmann
Is your simulation using a lot of memory?
Can you make the simulation fail earlier/more often or later/less often by
changing the scenario size?

Am Di., 19. Mai 2020 um 12:03 Uhr schrieb marcelreppi :

> Hello,
>
> my TraCI implementation suddenly quits at random timesteps with "Error: bad
> allocation".
>
> I have been trying to debug my code for hours but I can't find the problem
> because there is no other more specific error message and it happens at
> different random timestep.
> I have also tried multiple SUMO version with the same behavior happening.
>
> When I run the simulation without TraCI everything is fine, but I need the
> custom logic.
>
> I would really appreciate some help!
>
> Thanks a lot!
>
> Best regards
> Marcel
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user