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

AP_Scripting: mavlink: fix potential deadlock and clean up #29257

Merged
merged 3 commits into from
Feb 10, 2025

Conversation

tpwrules
Copy link
Contributor

@tpwrules tpwrules commented Feb 8, 2025

If the second allocation failed, receiving a MAVLink message could deadlock as the script thread would never release the lock yet the main thread would see the partial initialization.

Also clean up while we are in there.

Tested on Cube Orange using the REPL that the functions still work.

If there is an error, the semaphore will never be released. Fix by only
calling functions which could cause errors after it's released.
Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tridge tridge merged commit c7f32c2 into ArduPilot:master Feb 10, 2025
100 checks passed
@tpwrules tpwrules deleted the pr/scripting-mavlink-fixup branch February 10, 2025 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants