Libpng 1.6.x is broken, switch back to 1.5.x before release?

Submitted by Koen Kooi on April 16, 2013, 9:06 a.m.

Details

Message ID 5B2FD9C3-A643-474B-BC8A-DB24FCCBAA1A@dominion.thruhere.net
State New
Headers show

Commit Message

Koen Kooi April 16, 2013, 9:06 a.m.
Hi,

I've been looking into the libpng problems people have been reporting (e.g. #4060) and tried to upgrade 1.16.1 to fix those. Long story short, 1.16.1 doesn't fix them. I'm currently using weston as a testbed and was able to narrow the problems with weston down to:

	cairo_surface_t *surface = cairo_image_surface_create_from_png(icon);

with ends up as:

	ERROR loading icon from file '/usr/share/icons/gnome/24x24/apps/utilities-terminal.png', error: 'out of memory' 

Reverting the 1.6.0 update and rebuilding cairo against 1.5.x makes it work, no errors in the log and I get window decorations instead of white squares. I'll see if I can get libpng-1.7.0beta07.tar.gz to build today, but I can't spend much time on that.

All in all I'd recommend adding back the 1.5.x recipe and D_P -1'ing the 1.6.x recipe. Thanks to shlib renaming the resulting libpng packages are parallel installable and PRSERV takes care of bumping affected recipes/packages. Switching to 1.5.x "just works" if you have this patch:

Koen

Patch hide | download patch | download mbox

diff --git a/meta/recipes-graphics/pango/pango.inc b/meta/recipes-graphics/pango/pango.inc
index f622903..c1beb9e 100644
--- a/meta/recipes-graphics/pango/pango.inc
+++ b/meta/recipes-graphics/pango/pango.inc
@@ -10,7 +10,7 @@  SECTION = "libs"
 LICENSE = "LGPLv2.0+"
 
 X11DEPENDS = "virtual/libx11 libxft"
-DEPENDS = "glib-2.0 fontconfig freetype zlib virtual/libiconv cairo elfutils harfbuzz"
+DEPENDS = "glib-2.0 fontconfig freetype zlib virtual/libiconv cairo elfutils harfbuzz libpng"

regards,


Comments

Ross Burton April 16, 2013, 9:34 a.m.
Hi,

On 16 April 2013 10:06, Koen Kooi <koen@dominion.thruhere.net> wrote:
> I've been looking into the libpng problems people have been reporting (e.g. #4060) and tried to upgrade 1.16.1 to fix those. Long story short, 1.16.1 doesn't fix them. I'm currently using weston as a testbed and was able to narrow the problems with weston down to:
>
>         cairo_surface_t *surface = cairo_image_surface_create_from_png(icon);
>
> with ends up as:
>
>         ERROR loading icon from file '/usr/share/icons/gnome/24x24/apps/utilities-terminal.png', error: 'out of memory'

I just spoke to Chris Wilson about this.  libpng 1.6 is throwing more
warnings to the caller, often about invalid PNG extensions that are
being ignored apparently, and cairo-png is being over-zealous (his
words) in handling the warnings, by turning them into errors.

static void
png_simple_warning_callback (png_structp png,
	                     png_const_charp error_msg)
{
    cairo_status_t *error = png_get_error_ptr (png);

    /* default to the most likely error */
    if (*error == CAIRO_STATUS_SUCCESS)
	*error = _cairo_error (CAIRO_STATUS_NO_MEMORY);

    /* png does not expect to abort and will try to tidy up after a warning */
}

The warnings are just warnings and libpng will continue to load the
images.  Sending a patch once this git clone has finished.

Ross
Andreas Müller April 16, 2013, 9:38 a.m.
On Tue, Apr 16, 2013 at 11:06 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
> Hi,
>
> I've been looking into the libpng problems people have been reporting (e.g. #4060) and tried to upgrade 1.16.1 to fix those. Long story short, 1.16.1 doesn't fix them. I'm currently using weston as a testbed and was able to narrow the problems with weston down to:
>
>         cairo_surface_t *surface = cairo_image_surface_create_from_png(icon);
>
> with ends up as:
>
>         ERROR loading icon from file '/usr/share/icons/gnome/24x24/apps/utilities-terminal.png', error: 'out of memory'
>
> Reverting the 1.6.0 update and rebuilding cairo against 1.5.x makes it work, no errors in the log and I get window decorations instead of white squares. I'll see if I can get libpng-1.7.0beta07.tar.gz to build today, but I can't spend much time on that.
>
> All in all I'd recommend adding back the 1.5.x recipe and D_P -1'ing the 1.6.x recipe. Thanks to shlib renaming the resulting libpng packages are parallel installable and PRSERV takes care of bumping affected recipes/packages. Switching to 1.5.x "just works" if you have this patch:
>
> diff --git a/meta/recipes-graphics/pango/pango.inc b/meta/recipes-graphics/pango/pango.inc
> index f622903..c1beb9e 100644
> --- a/meta/recipes-graphics/pango/pango.inc
> +++ b/meta/recipes-graphics/pango/pango.inc
> @@ -10,7 +10,7 @@ SECTION = "libs"
>  LICENSE = "LGPLv2.0+"
>
>  X11DEPENDS = "virtual/libx11 libxft"
> -DEPENDS = "glib-2.0 fontconfig freetype zlib virtual/libiconv cairo elfutils harfbuzz"
> +DEPENDS = "glib-2.0 fontconfig freetype zlib virtual/libiconv cairo elfutils harfbuzz libpng"
>
> regards,
>
> Koen
I would like to bisect this - test case are the network-manager-applet
icons for WLAN. If libpng-1.7.0beta07 fixes let me know.

Andreas
Ross Burton April 16, 2013, 9:47 a.m.
On 16 April 2013 10:38, Andreas Müller <schnitzeltony@googlemail.com> wrote:
> I would like to bisect this - test case are the network-manager-applet
> icons for WLAN. If libpng-1.7.0beta07 fixes let me know.

There are two issues - one is that cairo-png is treating every warning
as fatal.  The other is that libpng 1.6 has stronger function call
ordering enforced, so cairo-png's loader causes a warning.  Which then
gets turned into the "out of memory" error.

I'm working with Chris Wilson now to try and sort this in cairo git,
so we can backport stuff.

Ross