GNOME Bugzilla – Bug 785975
When closing annotation windows, Evince runs into a busy loop
Last modified: 2017-09-30 07:33:02 UTC
Created attachment 357162 [details] A full backtrace from gdb attached to evince Steps to reproduce: unclear. Something about removing annotation windows. Maybe related to https://bugzilla.gnome.org/show_bug.cgi?id=782758. What happens: Exaile does not react to user input any more. It runs into a busy loop. After attaching gdb to evince, I get this backtrace (full backtrace attached):
+ Trace 237784
Additional info: I think I know why this bug happens and when it has been introduced: In ev_view_remove_window_child_for_annot (https://git.gnome.org/browse/evince/tree/libview/ev-view.c?h=gnome-3-24#n3007), the while loop will never be left if there is any window with "child->page != page", because the "continue" statement happens before any change to the loop variable "children" is done. This bug has been introduced in https://git.gnome.org/browse/evince/commit/libview/ev-view.c?id=d4b76d5ca904d5dc28d3f96d35fbb63e9d5c2874 when trying to fix https://bugzilla.gnome.org/show_bug.cgi?id=760299.
thanks for the bug. I will look into it asap
oh... I see you are right... How silly of me :( Care to propose a patch?
Created attachment 357221 [details] [review] view: Fix infinite loop over annotation windows When fixing bug 760299, we introduced an infinite loop that is triggered (sometimes) when removing annotations. This patch fixes that.
This should fix the infinite loop by ensuring we iterate over the list before continuing... Carlos, I opted for this instead of adding a new variable to hold the old pointer of children (which is needed to delete). The other way would be to just put the delete code inside an if clause and remove the continue.
(In reply to José Aliste from comment #2) > oh... I see you are right... How silly of me :( Care to propose a patch? It would take me a while, but you were faster ;) Your patch looks good to me.
Comment on attachment 357221 [details] [review] view: Fix infinite loop over annotation windows Thanks!
Will there be a 3.24.1 release, with this patch applied? The next stable release, 3.26.0, is expected to be released in ~4 weeks and it will take some more time to get it into downstream distros.
(In reply to Christian Stadelmann from comment #7) > Will there be a 3.24.1 release, with this patch applied? I meant 3.24.2, of course, not 3.24.1, which has been released 4 weeks ago.
I just pushed the patch to the 3.24 branch. Carlos, can you make the release? Or should we include other fixes into it?
(In reply to José Aliste from comment #9) > I just pushed the patch to the 3.24 branch. > > Carlos, can you make the release? Or should we include other fixes into it? Done