autoware.universe icon indicating copy to clipboard operation
autoware.universe copied to clipboard

control_performance_analysis crashes with segfault

Open kasper-helm opened this issue 1 year ago • 5 comments

Checklist

  • [X] I've read the contribution guidelines.
  • [X] I've searched other issues and no duplicate issues were found.
  • [X] I'm convinced that this is not my fault but a bug.

Description

I have seen control_performance_analysis crash when the idx_prev_wp_ pointer is not initialized, and is dereferenced on https://github.com/autowarefoundation/autoware.universe/blob/main/control/control_performance_analysis/src/control_performance_analysis_core.cpp#L378

  • this happens when the ego is either beyond acceptable_max_distance_to_waypoint_ from the trajectory, or the heading error is larger than acceptable_max_yaw_difference_rad_, which causes closest_segment to be empty, and the idx_prev_wp_ to remain uninitialized

Expected behavior

The node should safely handle the case where closest_segment is empty

Actual behavior

[ERROR] [control_performance_analysis_exe-24]: process has died [pid 216, exit code -11, cmd ...

Steps to reproduce

  • I am using a pre-defined fixed Trajectory message to test the Autoware control component without the planning component
  • This issue occurs when the localization initializes while the vehicle is somewhat far (> a few meters) from the trajectory

Versions

No response

Possible causes

No response

Additional context

No response

kasper-helm avatar Aug 01 '23 22:08 kasper-helm

This pull request has been automatically marked as stale because it has not had recent activity.

stale[bot] avatar Oct 02 '23 09:10 stale[bot]

@kasper-helm Thank you so much for your report and sorry for late response :sob: If it's possible, could you give me the information how to reproduce problem? (e.g. which version of autoware you are using, how did you launch autoware, which comman did you run to publish trajectory.

kyoichi-sugahara avatar Feb 17 '24 19:02 kyoichi-sugahara

I think I fixed it by adding the following line above https://github.com/autowarefoundation/autoware.universe/blob/main/control/control_performance_analysis/src/control_performance_analysis_core.cpp#L378

if (!idx_prev_wp_) { return std::nullopt; }

kasper-helm avatar Feb 20 '24 15:02 kasper-helm

@kasper-helm Wonderful thanks! Sorry for not supporting well :cry: If you create PR, I will review the PR :+1:

kyoichi-sugahara avatar Feb 20 '24 16:02 kyoichi-sugahara

This pull request has been automatically marked as stale because it has not had recent activity.

stale[bot] avatar Apr 20 '24 22:04 stale[bot]