Page MenuHomePhabricator

Several PNG thumbnail sizes of a specific SVG image do not display correctly
Open, Needs TriagePublic

Description

I was pointed out to the following broken thumbnail: https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Zevenhuizen_Moerkapelle_wapen.svg/375px-Zevenhuizen_Moerkapelle_wapen.svg.png

The commons image page is: https://commons.wikimedia.org/wiki/File:Zevenhuizen_Moerkapelle_wapen.svg

As you can see (hopefully) is that the thumbnail is not completely generated, only the bottom part. Not sure if this is a one off, or a more general problem.

Event Timeline

Akoopal created this task.Jan 25 2019, 10:48 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 25 2019, 10:48 PM
Aklapper renamed this task from image corruption to Several PNG thumbnail sizes of a specific SVG image do not display correctly.Jan 26 2019, 1:36 PM
Aklapper added a project: Thumbor.
Gilles added a subscriber: Gilles.Feb 26 2019, 12:49 PM

Seems like this happens only for some sizes. Probably a librsvg bug.

Cannot reproduce locally with rsvg-convert -h 375 -f png -o Zevenhuizen_Moerkapelle_wapen.png Zevenhuizen_Moerkapelle_wapen.svg but I'm already on librsvg2-2.44.13-1.fc29.x86_64 (plus I guess we don't use rsvg-convert for this job).

We do use rsvg-convert, Stretch is on libsrvg 2.40.16-1. This is very likely to be something that would be fixed by a librsvg upgrade.

Aklapper moved this task from Backlog to Patch merged upstream on the Upstream board.

Looks like librsvg may have regressed on this issue since 2.44.13, as conversion fails for all thumbnails where the width is between 310 and 395 inclusive using 2.48.4.

$ RUST_BACKTRACE=full rsvg-convert -w 395 -f png -u -o Zevenhuizen_Moerkapelle_wapen.svg.png Zevenhuizen_Moerkapelle_wapen.svg
thread '<unnamed>' panicked at 'Cairo error "out of memory"', /build/.cargo/registry/src/github.com-1ecc6299db9ec823/cairo-rs-0.8.1/src/enums.rs:274:13
stack backtrace:
   0:     0x7ff4c0d104df - <unknown>
   1:     0x7ff4c0b74eec - <unknown>
   2:     0x7ff4c0d0f9c6 - <unknown>
   3:     0x7ff4c0d0f610 - <unknown>
   4:     0x7ff4c0d0edd6 - <unknown>
   5:     0x7ff4c0d0e978 - <unknown>
   6:     0x7ff4c0d0e920 - <unknown>
   7:     0x7ff4c0ca53ce - <unknown>
   8:     0x7ff4c0ca4758 - <unknown>
   9:     0x7ff4c0c84895 - <unknown>
  10:     0x7ff4c0c84653 - <unknown>
  11:     0x7ff4c0c82e79 - <unknown>
  12:     0x7ff4c0c83d66 - <unknown>
  13:     0x7ff4c0cbcdd4 - <unknown>
  14:     0x7ff4c0c7f629 - <unknown>
  15:     0x7ff4c0cbcc3d - <unknown>
  16:     0x7ff4c0c84895 - <unknown>
  17:     0x7ff4c0c84653 - <unknown>
  18:     0x7ff4c0c82e79 - <unknown>
  19:     0x7ff4c0c83d66 - <unknown>
  20:     0x7ff4c0ca1f6b - <unknown>
  21:     0x7ff4c0c7f629 - <unknown>
  22:     0x7ff4c0ca15cf - <unknown>
  23:     0x7ff4c0c84895 - <unknown>
  24:     0x7ff4c0c84653 - <unknown>
  25:     0x7ff4c0c82e79 - <unknown>
  26:     0x7ff4c0d081cf - <unknown>
  27:     0x7ff4c0d07e8c - <unknown>
  28:     0x7ff4c0b58209 - rsvg_rust_handle_render_cairo_sub
  29:     0x55eaf1b7c9af - <unknown>
  30:     0x7ff4c0349002 - __libc_start_main
  31:     0x55eaf1b7d7de - <unknown>
  32:                0x0 - <unknown>
fatal runtime error: failed to initiate panic, error 5
fish: “RUST_BACKTRACE=full rsvg-conver…” terminated by signal SIGABRT (Abort)

If it works on 2.44.10-2.1 (the current Debian buster version) we should be fine for a while though.

AntiCompositeNumber moved this task from Backlog to Upstream on the Thumbor board.May 22 2020, 2:12 AM
toorich changed the status of subtask T193352: Update librsvg to ≥2.42.3 (2.44.10) from Stalled to Open.Jun 24 2020, 9:59 AM
Aklapper changed the status of subtask T193352: Update librsvg to ≥2.42.3 (2.44.10) from Open to Stalled.Jun 24 2020, 10:34 AM