fix: [Bug Report] osrm-routed segfaults/asserts#7412
Merged
DennisOSRM merged 5 commits intomasterfrom Mar 20, 2026
Merged
Conversation
Issue: #7203 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an MLD heap update edge case that could touch previously removed nodes, leading to osrm-routed asserts/segfaults (#7203).
Changes:
- Prevent
insertOrUpdatefrom updating a heap node when that node has been marked as removed. - Add a unit test covering the “removed node should not be updated” scenario.
- Document the fix in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| unit_tests/engine/offline_facade.cpp | Adds a regression unit test verifying removed heap nodes are not updated by insertOrUpdate. |
| include/engine/routing_algorithms/routing_base_mld.hpp | Updates insertOrUpdate logic to skip updates for nodes marked removed. |
| CHANGELOG.md | Adds an unreleased changelog entry describing the crash fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…e requirement The insertOrUpdate function was calling heap.WasRemoved(node), which added an implicit requirement on the Heap template parameter that could produce hard-to-decipher errors for Heap types that don't implement WasRemoved. Instead, add a WasRemoved() method directly to HeapNode (which, as a nested struct of QueryHeap, can access the private HeapContainer::INVALID_HANDLE), and call heapNode->WasRemoved() in insertOrUpdate. This keeps the removed- state check self-contained in the node and removes the extra constraint from the Heap template parameter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7203
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com