Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix panic due to non-total ordering in Area::compare_order() #5569

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

HactarCE
Copy link
Contributor

@HactarCE HactarCE commented Jan 2, 2025

Area::compare_order() is not a total ordering. If three layers A, B, and C have the same order field but only A and B are present in order_map, then A==C and B==C but A!=C. This can cause a panic in the stdlib sort function, and does in my app although it's very difficult to reproduce.

  • I have self-reviewed this PR and run ./scripts/check.sh
  • I have followed the instructions in the PR template

Copy link

github-actions bot commented Jan 2, 2025

Preview available at https://egui-pr-preview.github.io/pr/5569-patch-2
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

crates/egui/src/memory/mod.rs Outdated Show resolved Hide resolved
@emilk emilk added bug Something is broken egui crash crash, panic, segfault, freeze, … labels Jan 2, 2025
Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the unit-test!

@emilk emilk merged commit 329c8f2 into emilk:master Jan 7, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken crash crash, panic, segfault, freeze, … egui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants