Skip to content

AP_SLCANIface: prevent hardfault on arm #30059

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
May 19, 2025

Conversation

robertlong13
Copy link
Contributor

@robertlong13 robertlong13 commented May 13, 2025

Setting _port to nullptr always carries a risk, as we may be interrupting a thread that was about to dereference it. Once we set _port, we could avoid setting it to nullptr again, and instead use a flag. This allows us to prevent a hardfault without needing a mutex (and this can be a pretty hot path, so it's probably best to avoid it).

@robertlong13
Copy link
Contributor Author

#30055

@peterbarker
Copy link
Contributor

Closes #30055

@tridge tridge force-pushed the pr/fix-slcan-hardfault branch from c01313a to e70134a Compare May 15, 2025 21:57
@tridge
Copy link
Contributor

tridge commented May 15, 2025

@robertlong13 seems like a reasonable approach, thanks!

@robertlong13 robertlong13 marked this pull request as ready for review May 15, 2025 22:21
@tridge tridge merged commit 02528d4 into ArduPilot:master May 19, 2025
102 checks passed
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.

3 participants