Page 1 of 1

Crash with not too much info why

Posted: 11 May 2020, 13:35
by rw1445

Coppeliasim keeps crashing but only intermittently and the only reason it gives is std::bad_alloc.

Full description from terminal:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
./ line 33: 4985 Aborted (core dumped) "$dirname/$appname" "${PARAMETERS[@]}"

I believe it is something to do with a height field I am creating from a Python program by calling a Lua function. ... sp=sharing

Above is a link to basically everything I am using:

18w 30t.ttm - is the robot model I have been using
terrain test ground mar20.ttt - the scene with the lua script in - program that creates the terrain - program that controls the robot, start/stop scene and calls

Other info - using latest coppeliasim on ubuntu 18 but the computer is reasonably basic. Processor: Intel® Core™ i5 CPU 650 @ 3.20GHz × 4 , Graphics: Intel® Ironlake Desktop

Been trying for about a week to try and figure out what might be causing this. Any help would be much appreciated. If there is any other info you need let me know.


Re: Crash with not too much info why

Posted: 12 May 2020, 12:26
by coppelia

you are saying it crashes intermittently... that means you can't easily reproduce the crash, right? So it happens every x minutes, or y hours approximately?
If you could find out which Python call happens last, that would already be a beginning. Are you using the legacy remote API? Does it happen only with one physics engine or with all of them?
Also, you could try to enable printing debug info via [menu bar --> Help -->Debug ] and enable Debug internal function access, Debug C API access and Debug Lua API access. Things will run much much slower however...


Re: Crash with not too much info why

Posted: 13 May 2020, 11:42
by rw1445
It can be reproduced but with a bit of time as I am looping the simulation run it happens within the first 1-15 min. It happens mid-run so when the robot it moving towards a target coordinate. I was using ODE with coppeliasim, downloaded old vrep and tried that with bullet 2.78 & ODE which did still created the crash. Currently trying it with Bullet and coppeliasim which so far hasn't crashed.

In the python script during the sim it only calls 4 function : Settargetvelocity, getposition, getorientation and getLastcmdtime.
The inputs to the function for the last three don't change and I printed to values of the target velocities which were always numbers so wouldn't be causing an error.

I did already run the Debug printing but couldn't make much sense of it, will upload that to the google drive folder.

The main thing is if I change the terrain to a bunch of steps instead (in my code t =2) it doesn't crash. So it seems to be some sort of interaction with the height field that I am creating.

Thanks for your help, it is much appreciated.

Re: Crash with not too much info why

Posted: 13 May 2020, 15:04
by rw1445
Update: Well sticking with coppelia and changing the physics engine to bullet 2.78 might have fixed it. Its been running for about a hour now without crashing. I would still like to know what was going wrong if possible. The reason I was using ODE was it seems to be the only one that deals with a cylinder on its side in a sensible manner (try it, its great).