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 JTC segfault on unload #515

Merged
merged 1 commit into from
Feb 8, 2023

Conversation

VX792
Copy link
Contributor

@VX792 VX792 commented Feb 4, 2023

Based on the discussion in #423 - the traj_home_point_ptr_ is a nullptr until the node is activated, so unloading from configured state (if no activation happened before) results in a segfault.

@codecov-commenter
Copy link

codecov-commenter commented Feb 4, 2023

Codecov Report

Merging #515 (60d3fa4) into master (e7f9962) will decrease coverage by 3.31%.
The diff coverage is 26.60%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #515      +/-   ##
==========================================
- Coverage   35.78%   32.48%   -3.31%     
==========================================
  Files         189        7     -182     
  Lines       17570      665   -16905     
  Branches    11592      357   -11235     
==========================================
- Hits         6287      216    -6071     
+ Misses        994      157     -837     
+ Partials    10289      292    -9997     
Flag Coverage Δ
unittests 32.48% <26.60%> (-3.31%) ⬇️

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

Impacted Files Coverage Δ
...ontroller/test/test_load_diff_drive_controller.cpp 12.50% <0.00%> (ø)
diff_drive_controller/src/odometry.cpp 42.16% <11.11%> (ø)
diff_drive_controller/src/speed_limiter.cpp 46.55% <11.11%> (ø)
...ive_controller/test/test_diff_drive_controller.cpp 17.62% <12.08%> (ø)
...troller/include/diff_drive_controller/odometry.hpp 20.00% <20.00%> (ø)
...iff_drive_controller/src/diff_drive_controller.cpp 39.22% <35.50%> (ø)
...de/diff_drive_controller/diff_drive_controller.hpp 100.00% <100.00%> (ø)
..._state_broadcaster/src/joint_state_broadcaster.cpp
...ectory_controller/test/test_trajectory_actions.cpp
...ontrollers/src/joint_group_velocity_controller.cpp
... and 191 more

Copy link
Contributor

@DasRoteSkelett DasRoteSkelett left a comment

Choose a reason for hiding this comment

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

The change makes total sense to me. I would however love to see a small test case, and the git messages could be squashed and the message could be a little bit more verbose.

Just my 2 cents.

Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

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

Great!

It would be cool to have small test case, but otherwise cool!

This commit fixes the segfault which happens when the JTC is unloaded, if it is in inactive state but was never activated.
@VX792
Copy link
Contributor Author

VX792 commented Feb 7, 2023

Done!

Commits are squashed and I also added a small test case.

@bmagyar bmagyar merged commit 6369faa into ros-controls:master Feb 8, 2023
@bmagyar
Copy link
Member

bmagyar commented Feb 10, 2023

@Mergifyio backport to humble

mergify bot pushed a commit that referenced this pull request Feb 10, 2023
This commit fixes the segfault which happens when the JTC is unloaded, if it is in inactive state but was never activated.

(cherry picked from commit 6369faa)
@mergify
Copy link
Contributor

mergify bot commented Feb 10, 2023

backport to humble

✅ Backports have been created

bmagyar pushed a commit that referenced this pull request Feb 10, 2023
This commit fixes the segfault which happens when the JTC is unloaded, if it is in inactive state but was never activated.

(cherry picked from commit 6369faa)

Co-authored-by: Márk Szitanics <szitanics@gmail.com>
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

7 participants