-
-
Notifications
You must be signed in to change notification settings - Fork 50
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(DiskBar): simplify and prevent invalid constraints #862
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not able to repro myself but just reading the diff LGTM - just the one comment posted. Presume you were able to repro and verify the fix.
May be related to #861 as well |
Hm I'm actually seeing a crash here with output:
backtrace:
Running with |
Yeah, so this is the same crash and backtrace as before. I wonder if this is not necessarily related to invalid constraints but some race condition or binding issue with Vala. Fixing up the constraints definitely improved things for me, but it wasn't 100% reproducible to begin with. If you're running the Daemon somewhere where you've got access to d-feet, could you run the GetDisks method on the installer system bus with argument "True" and drop the output here? I'll look at what constraints we're generating for your disk layout and see if there's anything I missed, but I probably need to do some more digging here. |
|
@danirabbit Thank you! I was able to reproduce the crash again with your disk layout. Should now be resolved for all cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! Thank you for fixing this!
Fixes #848
Turns out the GTK constraint solver crashes (unpredictably? not always) when you give it invalid constraints, so I've made multiple improvements here to make the code clearer and remove most (all?) of the possibilities where we could be passing invalid constraints.
The main issue was clamping the percentages between 1% and 99%. Imagine a case where a disk has 3 partitions and the first two partitions use <1% of the disk and the 3rd partition uses >99%. We then clamp these percentages to
[1, 1, 99]
, which according to my calculations adds up to 101%. This makes the GTK constraint solver sad.Changes
PartitioningView.vala
, this allows reproducing the crashing issue in Installer crashes when navigating to the custom installation view with a system storage with custom partition setup #848 prior to the other changes, and should help test for regressions in future.