GNOME Bugzilla – Bug 759084
librsvg 2.40.12 crashes rendering SVGs with filters
Last modified: 2016-01-29 15:36:21 UTC
Created attachment 316833 [details] [review] Attempted fix; did not work. librsvg crashes when rendering SVGs with filters, as used by at least Cinnamon and the preferences window of the shell extension "Dash to dock". I've reproduced it with the latter. The extension renders this SVG: https://raw.githubusercontent.com/micheleg/dash-to-dock/master/media/logo.svg Upstream bug: https://bugs.archlinux.org/task/47245 Stack trace:
+ Trace 235787
Apparently there are destroyed surfaces on the render->surfaces_stack. However, there seem to be deeper issues as simply adding references for the stack (as done by the attached patch) results in bad rendering — a solid blue output. Attempting to open logo.svg in eog crashes as well. Opening logo.svg with rsvg-view-3 does not crash, but it still shows an error: (rsvg-view-3:19324): librsvg-CRITICAL **: rsvg_filter_render: assertion 'cairo_surface_get_type (source) == CAIRO_SURFACE_TYPE_IMAGE' failed
Er, that should have been "Downstream bug:", of course.
This is a regression in 2.40.12, fwiw. With 2.40.11 the logo.svg is processed properly.
git bisect shows the following as the (first) faulty commit: commit 9fc56102ca1861e3868fd6dcbcc3cc0f3c240f3e Author: Benjamin Otte <otte@redhat.com> Date: Wed Oct 7 10:37:22 2015 +0200 state: Resolve filters lazily We're almost there resolving everything lazily... Benjamin, would be great if you can have a look
The extension updated the logo to avoid triggering this bug. Here's the old logo which still causes crashes: https://raw.githubusercontent.com/micheleg/dash-to-dock/370f6e07c2dae6aa527b9054a154ae3b0e619ce7/media/logo.svg (2.40.13 is not fixed yet.)
commit d937c691678803ceda6be701587d997ccd03a1da Author: Benjamin Otte <otte@redhat.com> Date: Fri Jan 29 12:49:55 2016 +0100 Don't crash when filters don't exist We put a new surface on the stack if a filter existed by name but we didn't pop it if the name didn't resolve to a real filter. New test: crash/bug759084.svg
fwiw, I can confirm it fixes the issues I was seeing. Thanks Benjamin