Skip to content

Fix controller activation crash on macOS (Fixes #604) (backport #2391) #2396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 15, 2025

This PR resolves #604, which caused a runtime crash on macOS during controller activation.

The issue stemmed from the use of std::defer_lock with std::unique_lock prior to calling wait() on a condition variable. On macOS, the underlying libc++ implementation strictly enforces that a mutex must be locked before invoking wait(). Since defer_lock does not acquire the lock, this led to undefined behavior and a crash at runtime.

This PR corrects the locking behavior by ensuring the mutex is properly locked before wait() is called, making the code safe and portable across platforms, including macOS.


This is an automatic backport of pull request #2391 done by Mergify.

Copy link

codecov bot commented Jul 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.65%. Comparing base (a34ef90) to head (1e05d51).
Report is 1 commits behind head on jazzy.

Additional details and impacted files
@@            Coverage Diff             @@
##            jazzy    #2396      +/-   ##
==========================================
- Coverage   88.69%   88.65%   -0.04%     
==========================================
  Files         145      145              
  Lines       16747    16747              
  Branches     1444     1444              
==========================================
- Hits        14853    14847       -6     
- Misses       1333     1339       +6     
  Partials      561      561              
Flag Coverage Δ
unittests 88.65% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
controller_manager/src/controller_manager.cpp 74.53% <100.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@saikishor saikishor merged commit 865a596 into jazzy Jul 16, 2025
13 of 14 checks passed
@saikishor saikishor deleted the mergify/bp/jazzy/pr-2391 branch July 16, 2025 01:38
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