Skip to content
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

fix(autoware_pointcloud_preprocessor): fix potential double unlock in concatenate node #10082

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

vividf
Copy link
Contributor

@vividf vividf commented Feb 7, 2025

Description

This PR resolves a potential double unlock issue in the concatenate node. Previously, under certain conditions, the mutex could be unlocked twice, leading to undefined behavior and potential segmentation faults.

Related links

Note: This PR needs to rebase after #10074 is merged.

Parent Issue:

  • Link

How was this PR tested?

  • Tested with unit test.
  • Tested with sample rosbag

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@vividf vividf requested a review from mojomex February 7, 2025 04:34
@vividf vividf self-assigned this Feb 7, 2025
@github-actions github-actions bot added the component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) label Feb 7, 2025
Copy link

github-actions bot commented Feb 7, 2025

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@vividf vividf added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Feb 7, 2025
Copy link

codecov bot commented Feb 7, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 26.80%. Comparing base (59f2208) to head (c6ab579).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...oncatenate_data/concatenate_and_time_sync_node.cpp 33.33% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10082      +/-   ##
==========================================
- Coverage   26.81%   26.80%   -0.01%     
==========================================
  Files        1414     1414              
  Lines      108279   108291      +12     
  Branches    41729    41730       +1     
==========================================
- Hits        29031    29026       -5     
- Misses      76367    76387      +20     
+ Partials     2881     2878       -3     
Flag Coverage Δ *Carryforward flag
differential 21.10% <60.00%> (?)
differential-cuda 19.38% <60.00%> (?)
total 26.80% <ø> (-0.01%) ⬇️ Carriedforward from 59f2208

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@knzo25
Copy link
Contributor

knzo25 commented Feb 19, 2025

@vividf
It seems there are several conflicts

@mojomex
Copy link
Contributor

mojomex commented Feb 19, 2025

As remarked by @knzo25 offline some days ago, and as per the discussion @drwnz @vividf @manato and I just had,. it might be better to remove all locking completely as the callbacks within one node will always be in a mutually exclusive callback group by default, even when using a multithreaded executor.
This makes concat effectively single-threaded and thus no locking is needed. Performance hasn't be a problem even with our more data-heavy architectures.

@knzo25
Copy link
Contributor

knzo25 commented Feb 19, 2025

@mojomex
My comments though, require checking how threading, callback groups and timers work in ros.
In my experience, some timers (there are several, and some work at a lower level) had weird behaviors (different clocks were used ages ago, during some transitions, probably from ros1)

@vividf vividf force-pushed the fix/potential_double_unlock branch from d8c5033 to e272e0b Compare February 19, 2025 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
Status: To Triage
Development

Successfully merging this pull request may close these issues.

3 participants