Giter VIP home page Giter VIP logo

Comments (3)

jonipol avatar jonipol commented on May 30, 2024 1

Thanks for quick response and the feedback! I will do this once I am back from my trip on Monday.

from navigation2.

SteveMacenski avatar SteveMacenski commented on May 30, 2024

I have been investigating this now for a bit. According to StackOverflow comment dereferencing the iterator returned by std::max_element when the input array is empty, can lead into segmentation fault. Running std::max_element(EmptyArray) returns EmptyArray.end(). I believe that is what happens in this case.

The C++ docs that I usually reference have some remark if that would be a problem that I see aren't listed there. But just being a sane person knowing STL, yeah your expectation there would align with mine. I think the documentation just had that case missing.

Can you adjust that to:

auto max_cost_it = std::max_element(node_costs.begin(), node_costs.end());
if (max_cost_it != node_costs.end() && *node_costs > max_cost) {

Does it go away? If so, submit a PR to main and I'll merge + backport it to all the distributions. Thanks for the note, I agree with your analysis that this is the culprit - but as you point out - we shouldn't have been able to get here with that empty if all's well above.

For myself I fixed this by returning early in similar fashion as on line 186. Simple if (d < sqrt_2) return AnalyticExpansionNodes(); and that seems to be working fine for me.

You can add that too! Why not both, I practice defensive programming.

from navigation2.

SteveMacenski avatar SteveMacenski commented on May 30, 2024

Merging imminent

from navigation2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.