RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.27k stars 1.26k forks source link

Fix Segmentation Fault in GraphOfConvexSets::SolveShortestPath #21662

Closed cohnt closed 2 months ago

cohnt commented 3 months ago

Suppose one solves a GCS problem using the relax-and-round strategy. If the relaxation is feasible (or at least, not shown to be infeasible by the solver, which I have caused in practice by using loose tolerances), but the mixed-integer problem is indeed infeasible, then there is a bug in the rounding procedure causing a segfault (or various other memory errors), due to running out of feasible paths.

It has a DRAKE_ASSERT, but this will not help someone using a release build. (Indeed, I found the bug by accident, and it took quite a while to both identify what I was doing wrong, and where in Drake the problem was even coming from.) I've added an informative error message, and a test case exposing this bug.

Tagging with priority high since this can segfault and it's on drake master.


This change is Reviewable