Skip to content

Fix the insecure comparison function#586

Open
footka wants to merge 2 commits intomasterfrom
issue/2026041600115470098
Open

Fix the insecure comparison function#586
footka wants to merge 2 commits intomasterfrom
issue/2026041600115470098

Conversation

@footka
Copy link
Copy Markdown
Member

@footka footka commented Apr 16, 2026

Task Description

The sort comparator called fast_check_status() to detect PX interrupts. Once an interrupt was triggered, the comparator returned false for all subsequent comparisons instead of performing the actual comparison. This broke the strict weak ordering required by std::sort, causing undefined behavior. Specifically, __unguarded_linear_insert underflowed the iterator and dereferenced a garbage pointer, leading to a memory_sanity_abort().

Solution Description

The fix ensures the comparator maintains strict weak ordering even when an interrupt is detected. The logic was adjusted so that the interrupt status is checked, but the comparator still returns a valid, deterministic boolean result based on the actual data comparison to satisfy the ordering requirements of the sorting algorithm.

Passed Regressions

Upgrade Compatibility

Other Information

Release Note

obdev and others added 2 commits April 17, 2026 09:48
@ob-robot ob-robot force-pushed the issue/2026041600115470098 branch from 90b2707 to 95a3a7a Compare April 17, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant