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

Solving Segmentation Fault on "differential_drive stop" (Patch for issue #22818) #23170

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

matteodelseppia
Copy link
Contributor

@matteodelseppia matteodelseppia commented May 22, 2024

Solved Problem

When calling "differential_drive stop" during a simulation involving a robot with differential drive like r1_rover, a missing return statement in DifferentialDrive.cpp was causing a segmentation fault due to access to already freed memory.

Fixes issue #22818

Solution

Adding a return statement after line 68 solves the issue.

When calling "differential_drive stop" a missing return statement was causing a segmentation fault due to access to already freed memory.
@matteodelseppia matteodelseppia changed the title Patch for issue #22818 Solving Segmentation Fault on "differential_drive stop" (Patch for issue #22818) May 22, 2024
@sfuhrer sfuhrer requested a review from PerFrivik May 24, 2024 12:33
Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

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

You're absolutely right. run() also immediately ends in this case in all other modules I checked. Sorry it took so long and thanks for contributing the fix 🙏

@MaEtUgR MaEtUgR merged commit de5087a into PX4:main Jun 3, 2024
83 of 89 checks passed
@matteodelseppia
Copy link
Contributor Author

@MaEtUgR , thanks, you the best

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.

None yet

2 participants