Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 467426 - x11-libs/cairo-1.12.14: Gentoo's cairo-libpng16.patch causes all PNG files to fail to load with libpng-1.6.2
Summary: x11-libs/cairo-1.12.14: Gentoo's cairo-libpng16.patch causes all PNG files to...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Ben de Groot (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: libpng16
  Show dependency tree
 
Reported: 2013-04-27 00:03 UTC by Richard Grenville
Modified: 2013-04-27 05:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Grenville 2013-04-27 00:03:45 UTC
Problem:

cairo-libpng16.patch, introduced in #465044, is probably causing every PNG image to fail to load with libpng-1.6.2, as libpng emits an error "info change after png_start_read_image or png_read_update_info". (But that patch is indeed necessary for cairo to work with libpng-1.6.1.) Lifting the patch fixes the issue here.

Background:

After upgrading to libpng-1.6.2, fcitx segfaults after start. Debugging shows fcitx failed to load a PNG image with cairo_image_surface_create_from_png(), and it isn't handling this correctly. I looked further and found seemingly cairo failed to load each and every PNG image, returning CAIRO_STATUS_NO_MEMORY, because it received the following error from libpng:

----
#0  png_simple_error_callback (png=0x555555d74f10, 
    error_msg=0x7ffff59e2200 "info change after png_start_read_image or png_read_update_info")
    at cairo-png.c:134
----

I tried with a test program from here < http://permalink.gmane.org/gmane.comp.lib.cairo/23741 >, to load a few random PNG images, exactly the same issue, so it isn't only a problem with fcitx, but in cairo.

When I look at the bug about libpng-1.6 on cairo side < https://bugs.freedesktop.org/show_bug.cgi?id=63487 >, I found them claiming the issue is fixed on libpng-1.6.2 already, so I removed cairo-libpng16.patch when compiling cairo, and the problem immediately goes away.

Reproducible: Always
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2013-04-27 05:20:54 UTC
Ben, this looked serious enough to go for non-maintainer commit for fast fix. I hope you don't mind.

+*cairo-1.12.14-r1 (27 Apr 2013)
+
+  27 Apr 2013; Samuli Suominen <ssuominen@gentoo.org> +cairo-1.12.14-r1.ebuild:
+  Stop applying bogus -libpng16.patch wrt #467426 by Richard Grenville