Golitsin Vyacheslavandmatlabbe c59e0d7c35 fix(DBDriver): resolve lock-order inversion between dbSafeAccess and trashes mutexes (#1775)
* fix(DBDriver): resolve lock-order inversion between dbSafeAccess and trashes mutexes

emptyTrashes() acquired _dbSafeAccessMutex while holding _trashesMutex
(M1->M0), whereas the load() path acquires _dbSafeAccessMutex and then,
inside loadQuery()->getLastWordId(), acquires _trashesMutex (M0->M1).
This opposite nesting forms a lock-order cycle that ThreadSanitizer flags
as a potential deadlock.

Acquire _dbSafeAccessMutex only after releasing _trashesMutex, matching
the sequential 'look in trash, then database' pattern used by every other
DBDriver accessor (getLastWordId, getLastMapId, getInvertedIndexNi, ...).

Refs: #1765

* Fxing the actual deadlock

* Added doc

---------

Co-authored-by: matlabbe <[email protected]>
2026-09-27 22:43:06 -07:00
2013-12-12 22:36:56 +00:00
2026-08-06 13:32:20 -07:00
2025-08-06 20:53:14 -07:00
2023-03-13 03:20:06 -07:00
2026-08-23 13:21:46 -07:00
2026-08-06 13:32:20 -07:00
2026-08-23 13:21:46 -07:00
2026-08-23 13:21:46 -07:00
2026-08-06 13:32:20 -07:00
2014-10-24 11:37:06 +00:00
2026-08-06 13:32:20 -07:00
2026-08-06 13:32:20 -07:00
2026-08-23 13:21:46 -07:00
2026-08-06 13:32:20 -07:00
2026-08-06 13:32:20 -07:00
2025-03-09 19:01:15 -07:00
2014-11-28 10:11:08 -05:00
2026-08-06 13:32:20 -07:00

rtabmap

RTAB-Map Logo

Release Downloads codecov License

RTAB-Map library and standalone application.

To use RTAB-Map under ROS, visit the rtabmap page on the ROS wiki.

Acknowledgements

This project is supported by IntRoLab - Intelligent / Interactive / Integrated / Interdisciplinary Robot Lab, Sherbrooke, Québec, Canada.

IntRoLab

CI Latest

CMake Linux Build Status
CMake Windows Build Status
CMake MaCOS Build Status
CMake ROS Build Status
Docker ROS Build Status
Android Build Status

ROS Binaries

ros-$ROS_DISTRO-rtabmap

ROS 1 Noetic Build Status
ROS 2 Humble Build Status
Jazzy Build Status
Kilted Build Status
Lyrical Build Status
Rolling Build Status
Docker rtabmap Docker Pulls
Languages
C++ 63.8%
C 29.7%
CMake 1.7%
Java 1.5%
Swift 0.9%
Other 2.3%