GNOME Bugzilla – Bug 769901
Reproducible freeze when scrolling the view fast
Last modified: 2016-08-19 08:06:15 UTC
GNOME Builder freezes completely if you scroll the text view too fast (using smooth 2finger scrolling, or with keybindings). This is particular reliably triggered with horizontal scrolling, but happens with vertical scrolling too. I have enabled visible trailing whitespace. When the freeze occurs, GNOME Builder is gone completely and the only solution is to kill the application, losing unsaved files. I have experienced this bug with Jade and HTML files, but I don't know if that's related or they just tend to have longer lines. Backtrace (the function that hangs is _gtk_source_space_drawer_draw):
+ Trace 236541
Version: current master. PS: Enjoy GUADEC, I can work around the problem for now, it's just annoying to lose data.
I can't reproduce the freeze with the GtkSourceView test-widget program. The whitespace drawing code has been refactored recently, but normally the logic didn't change, at least not around the call to gtk_text_view_get_iter_at_location().
Is the CPU at 100%, i.e. is it an infinite loop? Or does it just freeze?
Yeah it's an infinite loop. It loops in the while(TRUE) IN _gtk_source_space_drawer_draw Oh and btw, I disabled visible spaces (was "Space", "Tab", "Trailing Only" before, nothing now) and I can't reproduce it any more.
Ok, I'll have a deeper look at the code soon. In the meantime, if someone succeeds to reproduce the problem on GSV test-widget, let me know.
This branch: https://git.gnome.org/browse/gtksourceview/log/?h=wip/space-drawing-fix should fix the infinite loop. But it's not tested.
Pushed commit d461b1b45d1aeb81416d6b7a650fc29573dd64c5. Feedback welcome. Reopen the bug if there is still an infinite loop.
Alright, now that I know what was going on, I was able to reproduce the bug: With text wrapping off (it can maybe happen with text wrapping too, I didn't test), type on the last line lots of tabs, so that there is an horizontal scrolling. It must be on the last line.
Thanks Sébastien, that issue was painful!