Skip to content

Dbdriver trash mutex build time protection - #1778

Merged
matlabbe merged 6 commits into
masterfrom
dbdriver_trash_mutex_build_time_protection
Sep 28, 2026
Merged

matlabbe merged 6 commits into
masterfrom
dbdriver_trash_mutex_build_time_protection

Conversation

@matlabbe

Copy link
Copy Markdown
Member

Follow-up of #1775 to generate a build error if someone calls a trash mutex protected public method from sqlite3's db mutex protected queries.

webzuweb and others added 5 commits September 27, 2026 16:07
…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
@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.97%. Comparing base (c59e0d7) to head (ffc3394).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1778      +/-   ##
==========================================
- Coverage   61.98%   61.97%   -0.01%     
==========================================
  Files         291      291              
  Lines       51361    51361              
==========================================
- Hits        31835    31831       -4     
- Misses      19526    19530       +4     
Files with missing lines Coverage Δ
corelib/include/rtabmap/core/DBDriverSqlite3.h 100.00% <ø> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

github-actions Bot added a commit that referenced this pull request Sep 28, 2026
@matlabbe
matlabbe merged commit b7079e0 into master Sep 28, 2026
28 of 33 checks passed
@matlabbe
matlabbe deleted the dbdriver_trash_mutex_build_time_protection branch September 28, 2026 05:44
github-actions Bot added a commit that referenced this pull request Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants