-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 crash when scrolling in smooth mode on empty thumbtable #18359
Fix crash when scrolling in smooth mode on empty thumbtable #18359
Conversation
…able There are different ways to check if the thumbtable is empty (for example, whether the thumbnail list is NULL). But we check whether the thumbnail size is zero as this is exactly what we are interested in, because later we would have to divide by this value, so we protect ourselves from division by zero.
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.
Thanks!
Merged in master & 5.0.x branch. |
Regarding the release notes. An entry in the release notes should have been added if this crash was in version 5.0.0 and we fixed it. But it's unlikely that such an obvious problem could have been missed when testing the smooth scrolling PR. So I checked if 5.0.0 crashed and... no, it didn't. Running it under the debugger showed that in 5.0.0 when entering So something changed between the release and a fairly recent development snapshot. @TurboGit @jenshannoschwalm Does this change ring a bell to you? It seems that the zero as the thumbnail size on an empty thumbtable is a side effect of some recent change in the darktable codebase. Was this expected? |
Unfortunately no. |
No, no idea except maybe a change of Gtk+ version? |
I highly doubt that changing the library version could have such an effect. Everything is possible, but... My guess is that this is a side effect of some change in darktable code. I'll bisect and find the culprit commit. |
Yes, it was a side effect of the following commit:
It looks like we somehow lost a call to some initialization code that was responsible for calculating thumb_size with these changes. @ralfbrown Any ideas? I don't think this is a serious regression, because although we ended up with a division-by-zero crash, it was actually a problem with the code that was dividing without proper safety checks. Rather, it is worth noting a certain architectural complexityy here if unrelated changes can have such unpredictable consequences. |
Lots of initializations are triggered by the initial realization of darktable's main window, which now happens much later.... Someone early in dt's development got overly clever with having GUI callbacks initiate things rather than simply making a direct call. |
Fixes #18357.