Fix route priority sort indexing#1222
Conversation
Signed-off-by: Bradley Dice <bdice@bradleydice.com>
📝 WalkthroughWalkthroughThis PR fixes an intermittent host heap corruption crash in the routing adapter by removing unsafe vector indexing from the sort comparator. The comparator now compares route lengths directly instead of using route IDs as indices into a temporary priority vector, eliminating out-of-bounds access when route IDs exceed the vector size. ChangesRoute Priority Sort Bounds Fix
🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
|
Uh oh, I see a crash in routing test: |
|
Think this is same failure as noted in the bug #1221 |
|
The There seems to be a separate bug in the same test: Attempting to reproduce that now. |
Summary
adapted_sol_t::priority_remove_diff_routesby sorting route ids directly onroutes[id].length.route_priorityvector by route id, which could corrupt the host heap and intermittently abortROUTING_TEST.Closes #1221. Closes #866. Closes #783.
Validation
Running many times under ASan no longer triggers the SIGABRT, though it was very hard to reproduce the previous failure before this fix.