I'm using the Python remote API to run a series of simulations. Each one is about 10 to 20 seconds long and I am stopping and starting the simulation after each run (to reset it to its original state). I am seeing V-REP crash often during these runs (typically 15 - 20 runs in). The error that shows up is:
vrep: ../nptl/pthread_mutex_lock.c:80: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.
Aborted (core dumped)
Any idea what is going on and how to fix it?
Crash when starting and stopping simulation with remote API
-
- Posts: 27
- Joined: 23 Sep 2014, 21:24
Re: Crash when starting and stopping simulation with remote
Hello,
can you tell us:
can you tell us:
- What OS?
- What V-REP version?
- What happens with a different simulation scene (e.g. an empty scene)? Will it still crash?
-
- Posts: 27
- Joined: 23 Sep 2014, 21:24
Re: Crash when starting and stopping simulation with remote
I'm running Ubuntu 14.04 and V-REP version 3.2.1
I haven't seen it crash on an empty scene yet. It seems very unpredictable. Sometimes it will run for hours and be fine, and other times it will crash after 30 minutes, and other times it will crash after 5 minutes. The error isn't always in the same place either. The last run I did got this error:
vrep: tpp.c:62: __pthread_tpp_change_priority: Assertion `new_prio == -1 || (new_prio >= __sched_fifo_min_prio && new_prio <= __sched_fifo_max_prio)' failed.
Aborted (core dumped)
I haven't seen it crash on an empty scene yet. It seems very unpredictable. Sometimes it will run for hours and be fine, and other times it will crash after 30 minutes, and other times it will crash after 5 minutes. The error isn't always in the same place either. The last run I did got this error:
vrep: tpp.c:62: __pthread_tpp_change_priority: Assertion `new_prio == -1 || (new_prio >= __sched_fifo_min_prio && new_prio <= __sched_fifo_max_prio)' failed.
Aborted (core dumped)
Re: Crash when starting and stopping simulation with remote
That kind of situation is always very difficult to debug unfortunately. You could try to write debug information to a file (check the debug options in [menu bar --> Help --> Debug]). Be aware that when turning debug information on, this will drastically slow down V-REP, so never forget to turn it off again later on. Maybe Debug internal function access and Debug C API access is a good start. If you could send us the last 1000 debug lines or so, just before a crash, that would be great.
Cheers
Cheers
-
- Posts: 27
- Joined: 23 Sep 2014, 21:24
Re: Crash when starting and stopping simulation with remote
I ran it with debug information on, it took about 2 days to finish and didn't crash. It might be that this error doesn't come up when it is being run slowly.
Re: Crash when starting and stopping simulation with remote
Can you modify your scene so that I can run it without Python code, and so that the crash still happens? At first, I'd like to know if the problem is linked to the remote API, or to your scene. Then I could debug it on my side.
Cheers
Cheers
-
- Posts: 27
- Joined: 23 Sep 2014, 21:24
Re: Crash when starting and stopping simulation with remote
I'm pretty sure it is related to how the Python code affects the scene.
One thing I noticed is that I was starting up the remote API from within the scene's initialization to a particular port, and I don't think it was being explicitly closed anywhere (I needed this in the past because I had two separate Python scripts that needed access to the scene, but I forgot to remove it for my current tests). My Python script that runs my tests opens up the remote API on the default port and closes it properly each time. I think the problem had to do with the fact that my Python script would start and stop the simulation a couple hundred times, and each time it started up again, that child script that opened a new remote API connection would get called. Somehow that interaction was causing the crashes. When I removed the child script that opened its own API connection, I haven't seen it crash since.
One thing I noticed is that I was starting up the remote API from within the scene's initialization to a particular port, and I don't think it was being explicitly closed anywhere (I needed this in the past because I had two separate Python scripts that needed access to the scene, but I forgot to remove it for my current tests). My Python script that runs my tests opens up the remote API on the default port and closes it properly each time. I think the problem had to do with the fact that my Python script would start and stop the simulation a couple hundred times, and each time it started up again, that child script that opened a new remote API connection would get called. Somehow that interaction was causing the crashes. When I removed the child script that opened its own API connection, I haven't seen it crash since.