Freeze in open preview if filter is applied to a group and its children

Steps to reproduce:

  • open Inkscape
  • File > Open
  • With file preview enabled (may need GTK open dialog), selecting assets-bug-minimal.svg results in a freeze and memory growth
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="200" height="480" viewBox="0 0 200 480">
  <defs>
    <filter id="recursiveblur" color-interpolation-filters="sRGB" x="0" y="0" width="1" height="1">
      <feGaussianBlur stdDeviation="1" in="composite1" result="blur"/>
    </filter>
  </defs>
    <g id="base-button" filter="url(#recursiveblur)">
      <g id="base-button-box" filter="url(#recursiveblur)">
        <rect width="20" height="20" fill="none"/>
      </g>
    </g>
</svg>

What happened?

  • freeze and memory growth.
  • Similar to inkscape#1627 (comment 615555995), which happens on export but requires a clip to be somewhere in the file (that bug doesn't affect this file).

What should have happened?

  • No freeze
  • Note: opening the file directly doesn't result in a freeze (i.e. running inkscape assets-bug-minimal.svg)

Debug info

  • Inkscape 1.2-dev (d2b775ce59, 2021-07-05) Linux Mint 20
  • Bisection says it's introduced in inkscape@11bdb726 so shouldn't be an issue in 1.0.2
Edited by Nathan Lee