autowarefoundation / autoware.universe

https://autowarefoundation.github.io/autoware.universe/
Apache License 2.0
965 stars 630 forks source link

control_performance_analysis crashes with segfault #4498

Open kasper-helm opened 1 year ago

kasper-helm commented 1 year ago

Checklist

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

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

Versions

No response

Possible causes

No response

Additional context

No response

stale[bot] commented 1 year ago

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

kyoichi-sugahara commented 7 months ago

@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.

kasper-helm commented 7 months ago

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; }

kyoichi-sugahara commented 7 months ago

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

stale[bot] commented 5 months ago

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