Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTable is stuck in an infinite loop sometimes #27083
Comments
MihaMarkic
changed the title
TableView is stuck in an infinite loop sometimes
Table is stuck in an infinite loop sometimes
Jan 25, 2019
This comment has been minimized.
This comment has been minimized.
Looks similar to #23723 |
This comment has been minimized.
This comment has been minimized.
Do you also get an exception? |
zoechi
added
framework
f: material design
labels
Jan 25, 2019
zoechi
added this to the Goals milestone
Jan 25, 2019
This comment has been minimized.
This comment has been minimized.
@zoechi No, it just loops infinitely because the condition is never satisfied (rounding with doubles problem, I guess). |
This comment has been minimized.
This comment has been minimized.
And of course, app becomes unresponsive due to this loop. |
This comment has been minimized.
This comment has been minimized.
Also, I'd push fix for this one sooner, not just "Goals" in coming years. Not because of me, well, also, but because this bug is insidious and happens only on certain screen size combinations. Imagine having an app in production and it becomes unresponsive for random customers/devices without any feedback. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
We've had similar rounding issues in slivers, we should use a small delta for our while-loop |
This comment has been minimized.
This comment has been minimized.
I was able to reproduce this almost immediately, will have PR up shortly |
This comment has been minimized.
This comment has been minimized.
Instead of using a small delta (how small should be the challenge - are you sure it will cover all values?), perhaps you might consider checking whether deficit changed in a last loop, or something slightly more reliable. |
jonahwilliams
referenced this issue
Jan 25, 2019
Merged
prevent _computeColumnWidths from getting stuck due to double precision #27112
This comment has been minimized.
This comment has been minimized.
Feel free to comment on PR |
jonahwilliams
closed this
in
#27112
Jan 26, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@zoechi You're right, that's different. |
MihaMarkic commentedJan 25, 2019
•
edited by zoechi
Steps to Reproduce
DefaultTabController->Scaffold->TabBarView
it might get stuck in an infinite loop.It gets stuck in
RenderTable._computeColumnWidths
method, specifically in this while loop:The problem is that deficit is a really small value
2.842170943040401e-14
and it won't get to or below0
.Other values are:
Basically
newWidth <= minWidths[x]
is always false and deficit doesn't decrease becausewidths[x] - newWidth
is always0
.This problem happens only on some screens and it is consistent when it starts (i.e. works on emulator and not on device - Nexus 6, or the other way round).
Logs
No useful logs (when it gets stuck nothing is reported).
No issues found! (ran in 3.4s)