After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773985 - cairo.Error: invalid value from do_draw() when GTK3 theme has scrollbar stepper buttons
cairo.Error: invalid value from do_draw() when GTK3 theme has scrollbar stepp...
Status: RESOLVED FIXED
Product: meld
Classification: Other
Component: general
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: meld-maint
meld-maint
Depends on:
Blocks:
 
 
Reported: 2016-11-05 16:48 UTC by Forest
Modified: 2016-11-08 20:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Forest 2016-11-05 16:48:18 UTC
Meld barfs up a bunch of tracebacks on stderr when the desktop's gtk3 theme has scrollbar stepper buttons.  This is particularly annoying when working at the command line, since all those traceback messages push everything else out of my terminal window.

It seems that DiffMap.do_draw() subtracts the combined height of the scrollbar steppers from self._scroll_height (no matter what the height is, and uses the result as the height argument to cairo.Surface.create_similar().  When self._scroll_height is only 1, that argument ends up being a negative number, which chokes cairo.

You won't see the bug unless your gtk3 theme uses scrollbar stepper buttons.  To reproduce, find a theme with something like this in its gtk-3.0/gtk-widgets.css:

    -GtkScrollbar-has-backward-stepper: true;
    -GtkScrollbar-has-forward-stepper: true;
    -GtkRange-stepper-size: 15px;

I can reproduce the bug by comparing directories while using any of these themes:

Greybird-Mod
https://www.gnome-look.org/p/1015000/

Windows 8 Gtk3
https://www.gnome-look.org/p/1013223/

Clearlooks-Phenix v6
https://www.gnome-look.org/p/1013756/

DarkMint
https://www.gnome-look.org/p/1013679/


Looks like bug 745452 might be related.
Comment 1 Forest 2016-11-05 16:49:14 UTC
Example traceback:

Traceback (most recent call last):
  • File "/usr/lib/python2.7/dist-packages/meld/diffmap.py", line 138 in do_draw
    width, height)
cairo.Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)


(Bugzilla was responding with error 500 when I tried submitting this as part of the bug description.)
Comment 2 Kai Willadsen 2016-11-07 21:40:23 UTC
Thanks for the excellent reproduction description! I've just pushed a fix for this to the 3.16 branch and current master.
Comment 3 Forest 2016-11-08 08:44:05 UTC
Thanks for taking quick action!

Nitpick: The old comment a couple lines above your fix is now misleading, in that someone could easily assume the negative value check to be unnecessary once that old cairo bug is fixed.
Comment 4 Kai Willadsen 2016-11-08 20:06:11 UTC
(In reply to Forest from comment #3)
> Nitpick: The old comment a couple lines above your fix is now misleading, in
> that someone could easily assume the negative value check to be unnecessary
> once that old cairo bug is fixed.

Fair point. Fixed now.