Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 494616 - media-gfx/optipng-0.7.4 built with libpng-1.2.44 but running with 1.6.7, Out of memory
Summary: media-gfx/optipng-0.7.4 built with libpng-1.2.44 but running with 1.6.7, Out ...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Sebastian Pipping
URL: https://bugs.gentoo.org/show_bug.cgi?...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-12-18 07:45 UTC by Massimo Burcheri
Modified: 2016-08-23 10:55 UTC (History)
1 user (show)

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


Attachments
media-gfx:optipng-0.7.3:20131218-122235.log (media-gfx:optipng-0.7.3:20131218-122235.log,7.39 KB, text/plain)
2013-12-18 12:43 UTC, Massimo Burcheri
Details
emerge --info media-libs/libpng media-gfx/optipng (file_494616.txt,6.24 KB, text/plain)
2013-12-18 12:52 UTC, Massimo Burcheri
Details
ls -l /usr/include/*png* /usr/lib/*png* (file_494616.txt,1.07 KB, text/plain)
2013-12-18 13:49 UTC, Massimo Burcheri
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Massimo Burcheri 2013-12-18 07:45:15 UTC
$ optipng -v *.png
OptiPNG version 0.7.4
Copyright (C) 2001-2012 Cosmin Truta and the Contributing Authors.

** Processing: screenshot-1386572383828.png
Warning: Application built with libpng-1.2.44 but running with 1.6.6
Error: Out of memory

$ eix media-libs/libpng
[I] media-libs/libpng
     Available versions: 
     (1.2)  1.2.50 ~1.2.50-r1
     (0)    1.5.15 1.5.17-r1 (~)1.6.6(0/16) ~1.6.7(0/16)
     (1.5)  ~1.5.17-r15
       {apng neon static-libs ABI_MIPS="n32 n64 o32" ABI_X86="32 64 x32"}
     Installed versions:  1.2.50(1.2)(02:09:58 12.11.2013) 1.6.6(08:13:02 09.12.2013)(apng static-libs -neon ABI_MIPS="-n32 -n64 -o32" ABI_X86="64 -32 -x32")
     Homepage:            http://www.libpng.org/
     Description:         Portable Network Graphics library

$ eix optipng
[I] media-gfx/optipng
     Available versions:  0.7.3 (~)0.7.3-r1 (~)0.7.4
     Installed versions:  0.7.4(08:13:58 09.12.2013)
     Homepage:            http://optipng.sourceforge.net/
     Description:         Compress PNG files without affecting image quality

$ ldd /usr/bin/optipng
   linux-vdso.so.1 (0x00007fff2d7ff000)
   libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007f561383f000)
   libz.so.1 => /lib64/libz.so.1 (0x00000032bf200000)
   libc.so.6 => /lib64/libc.so.6 (0x00000032be600000)
   libm.so.6 => /lib64/libm.so.6 (0x00000032bf600000)
   /lib64/ld-linux-x86-64.so.2 (0x00000032be200000)

$ USE="-static-libs" emerge -auNDtv optipng

  (media-libs/libpng-1.6.7::gentoo, ebuild scheduled for merge) conflicts with
    >=media-libs/libpng-1.4.3[static-libs] required by (media-gfx/splashutils-1.5.4.4-r4::gentoo, installed)

But I tried without splashutils and USE="-static-libs"

$ emerge -atv --keep-going @preserved-rebuild

$ revdep-rebuild -iv -- -avt --keep-going

$ ls -al /usr/lib64/libpng*
-rwxr-xr-x 1 root root 155K Dez 11 09:30 /usr/lib64/libpng12.so.0*
lrwxrwxrwx 1 root root   19 Apr 24  2013 /usr/lib64/libpng15.so.15 -> libpng15.so.15.15.0*
-rwxr-xr-x 1 root root 186K Apr 24  2013 /usr/lib64/libpng15.so.15.15.0*
lrwxrwxrwx 1 root root   18 Dez 11 09:49 /usr/lib64/libpng16.so -> libpng16.so.16.6.0*
lrwxrwxrwx 1 root root   18 Dez 11 09:49 /usr/lib64/libpng16.so.16 -> libpng16.so.16.6.0*
-rwxr-xr-x 1 root root 218K Dez 11 09:49 /usr/lib64/libpng16.so.16.6.0*
lrwxrwxrwx 1 root root   11 Dez 11 09:49 /usr/lib64/libpng.so -> libpng16.so*

$ LD_PRELOAD="/usr/lib64/libpng12.so.0" optipng ./error_screenshot.png
** Processing: ./error_screenshot.png
Warning: Application built with libpng-1.2.49 but running with 1.6.6
Error: Out of memory

** Status report
1 file(s) have been processed.
1 error(s) have been encountered.

$ cd /usr/lib64; sudo ln -sf libpng12.so.0 libpng16.so.16   # testing
‘libpng16.so.16’ -> ‘libpng12.so.0’

$ optipng ./error_screenshot.png
optipng: /usr/lib64/libpng16.so.16: version `PNG16_0' not found (required by optipng)

$ cd /usr/lib64; sudo ln -sf libpng16.so.16.6.0 libpng16.so.16   # recovering
‘libpng16.so.16’ -> ‘libpng16.so.16.6.0’	


I also tried current amd64 media-gfx/optipng-0.7.3.
I also removed libpng completely and emerged the stable:

Installed versions:  1.2.50(1.2)(12:15:05 17.12.2013) 1.5.17-r1(12:50:06 17.12.2013)(apng -neon -static-libs)

$ ldd $(type -p optipng)
	linux-vdso.so.1 (0x00007fff7b3ff000)
	libpng15.so.15 => /usr/lib64/libpng15.so.15 (0x00000037c3600000)
	libz.so.1 => /lib64/libz.so.1 (0x00000032bf200000)
	libc.so.6 => /lib64/libc.so.6 (0x00000032be600000)
	libm.so.6 => /lib64/libm.so.6 (0x00000032bf600000)
	/lib64/ld-linux-x86-64.so.2 (0x00000032be200000)

$ optipng -v ./tmp/hexchat_account.png
OptiPNG version 0.7.3
Copyright (C) 2001-2012 Cosmin Truta and the Contributing Authors.

** Processing: ./tmp/hexchat_account.png
Warning: Application built with libpng-1.6.3 but running with 1.5.17
Error: Out of memory

** Status report
1 file(s) have been processed.
1 error(s) have been encountered.

Reproducible: Always
Comment 1 Massimo Burcheri 2013-12-18 09:38:19 UTC
I also tried re-emerge with -static-libs:

USE="-static-libs" emerge -atv libpng optipng
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2013-12-18 12:08:54 UTC
the message implies optipng was compiled using headers from libpng 1.2, but the libpng 1.2 from SLOT="1.2" you might have co-installed with 1.6 doesn't install any headers at all

so, got old libpng headers at /usr/local/include (or perhaps even /usr/include) ?
you definately shouldn't, only libpng 1.6 headers should be there:

ssuominen@null ~ $ ls -ld /usr/include/libpng*
drwxr-xr-x 2 root root 4096 Dec  1 09:50 /usr/include/libpng16
ssuominen@null ~ $ ls -ld /usr/local/include/libpng*
ls: cannot access /usr/local/include/libpng*: No such file or directory
Comment 3 Massimo Burcheri 2013-12-18 12:26:21 UTC
Current installation of libpng is amd64 stable only now:

$ ls -ld /usr/include/libpng*
drwxrwxr-x 2 root root 4,0K Dez 18 10:43 /usr/include/libpng15/

$ ls -ld /usr/local/include/libpng*
ls: cannot access /usr/local/include/libpng*: No such file or directory

$ emerge --info media-libs/libpng
...
=================================================================
                        Package Settings
=================================================================

media-libs/libpng-1.2.50 was built with the following:
USE="(multilib)" ABI_X86="64"


media-libs/libpng-1.5.17-r1 was built with the following:
USE="apng static-libs (-neon)"

$ ls -al /usr/lib64/libpng*.so*
-rwxr-xr-x 1 root root 155K Dez 17 12:15 /usr/lib64/libpng12.so.0*
lrwxrwxrwx 1 root root   19 Dez 18 10:43 /usr/lib64/libpng15.so -> libpng15.so.15.17.0*
lrwxrwxrwx 1 root root   19 Dez 18 10:43 /usr/lib64/libpng15.so.15 -> libpng15.so.15.17.0*
-rwxr-xr-x 1 root root 186K Apr 24  2013 /usr/lib64/libpng15.so.15.15.0*
-rwxr-xr-x 1 root root 183K Dez 18 10:43 /usr/lib64/libpng15.so.15.17.0*
lrwxrwxrwx 1 root root   11 Dez 18 10:43 /usr/lib64/libpng.so -> libpng15.so*

There is some libpng12 left, but this did not help either:
$ mv /usr/lib64/libpng12.so.0 /usr/lib64/libpng12.so.0.old && emerge optipng
$ mv /usr/lib64/libpng12.so.0.old /usr/lib64/libpng12.so.0
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2013-12-18 12:31:54 UTC
The .ebuild should remove the package shipped old libpng headers, like so:

optipng-0.7.4.ebuild:	rm -R src/{libpng,zlib} || die

And the libpng.pc point to the latest headers:

$ pkg-config --cflags libpng
-I/usr/include/libpng16

Really, this isn't hard to figure out. It's a simple mismatch of headers and the library. 
But if you really can't provide the details why it happened, then at least provide comprehensive outputs like the complete optipng build.log, emerge --info, ls -l /usr/include/*png*, ls -l /usr/lib/*png*, and such listings
Thanks.
Comment 5 Massimo Burcheri 2013-12-18 12:43:27 UTC
Created attachment 365596 [details]
media-gfx:optipng-0.7.3:20131218-122235.log
Comment 6 Massimo Burcheri 2013-12-18 12:52:08 UTC
Created attachment 365598 [details]
emerge --info media-libs/libpng media-gfx/optipng
Comment 7 Massimo Burcheri 2013-12-18 13:49:02 UTC
Created attachment 365600 [details]
ls -l /usr/include/*png* /usr/lib/*png*
Comment 8 Massimo Burcheri 2014-02-21 10:00:59 UTC
No updates and not fixed yet. If this isn't hard to figure out, so at least how can this be fixed, no matter what was leading to this situation?
Comment 9 Pacho Ramos gentoo-dev 2016-08-19 13:22:11 UTC
Still valid with 0.7.6?
Comment 10 Sebastian Pipping gentoo-dev 2016-08-19 14:27:45 UTC
Hi!

Neither optipng-0.7.4 nor libpng-1.2.44 are in Gentoo, still.
I would dare to close this one as obsolete.

Massimo, if you run into it again, please re-open and we try to get it fixed in time, next time.  Okay?

Best, Sebastian
Comment 11 Sebastian Pipping gentoo-dev 2016-08-19 14:30:56 UTC
PS: There is mentioned

  rm -R src/{libpng,zlib} || die

in the (one and only 0.7.6) ebuild by now.
Comment 12 Massimo Burcheri 2016-08-23 06:19:29 UTC
0.7.6 is working fine today.
Comment 13 Sebastian Pipping gentoo-dev 2016-08-23 10:55:01 UTC
(In reply to Massimo Burcheri from comment #12)
> 0.7.6 is working fine today.

Thanks for the update!