Gazebo crash "void boost::recursive_mutex::lock(): Assertion `!pthread_mutex_lock(&m)' failed."

asked 2020-04-27 04:57:23 -0500

Clément Rolinat gravatar image


gzserver is crashing apparently at a random time with the following error :

gzserver: /usr/include/boost/thread/pthread/recursive_mutex.hpp:113: void boost::recursive_mutex::lock(): Assertion `!pthread_mutex_lock(&m)' failed.
Aborted (core dumped)
[gazebo-3] process has died [pid 3901, exit code 134

there is no other error message.

This crash occur after running the same simulation several hours straight. Sometimes it crash after 2 hours, sometimes after more than 10 hours.

My gazebo is installed via apt, and I use it with ROS. I added a model plugin and a sensor plugin, but I use only the gazebo API in it, and I'm not using directly any mutex or thread.

How can I set the backtrace to report the crashed gazebo file, and not only the boost library file, which is not very helpful ? Does anyone have an idea on what could cause this crash ?

edit retag flag offensive close merge delete


I have the same problem. It would be a big relief to get a solution for this, as I need to run the simulation for as long as possible for machine learning training and the crashes are a huge setback for that.

Favodar gravatar imageFavodar ( 2020-06-18 07:22:35 -0500 )edit

I made some tests on an other computer, but this time with gazebo installed from source with the gazebo9 branch, and the problem seems to disappear. So I don't know if this is computer dependent or if there is an issue with the gazebo from apt.

Clément Rolinat gravatar imageClément Rolinat ( 2020-07-01 03:41:38 -0500 )edit

Did you ever rootcause this? I have the same crash message, but in a ROS application that does not use Gazebo. E.g. did you notice if it was related to boost version?

krix gravatar imagekrix ( 2020-12-21 11:28:08 -0500 )edit

In my case, this bug appears only with gazebo binary from apt. I didn't saw it with other apt binary ros application.

Clément Rolinat gravatar imageClément Rolinat ( 2021-04-08 02:32:36 -0500 )edit