I am on a ~amd64 system and I can't emerge any version (2.21, 2.22) of keepass. I also tried on a different system, ~amd64, hardened with the same problem. Another user who I asked to test the ebuild, got the same error but I do not know his installation info. I tried with both mono-2.10.9-r2 and mono-3.0.7. It fails with the errors of the attached build.log. For reference, some of them are: libpng error: invalid after png_start_read_image or png_read_update_info Unhandled Exception: System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter] /usr/lib64/mono/3.5/Microsoft.Common.targets: error : Tool exited with code: 1. Output: No protocol specified libpng error: invalid after png_start_read_image or png_read_update_info Read in 155 resources from '/var/tmp/portage/app-admin/keepass-2.22/work/KeePass/Properties/Resources.resx' Error: A null reference or invalid value was found [GDI+ status: InvalidParameter] Reproducible: Always My main system info is shown below. My other test system where keepass fails too, has a very simple setup (minimal USE flags, no overlays except a personal one). # emerge --info '=app-admin/keepass-2.22' Portage 2.1.12.2 (default/linux/amd64/13.0/desktop/kde, gcc-4.7.3, glibc-2.17, 3.9.4-gentoo-Alfred x86_64) ================================================================= System Settings ================================================================= System uname: Linux-3.9.4-gentoo-Alfred-x86_64-Intel-R-_Core-TM-_i7-3630QM_CPU_@_2.40GHz-with-gentoo-2.2 KiB Mem: 8125220 total, 632580 free KiB Swap: 0 total, 0 free Timestamp of tree: Sat, 08 Jun 2013 01:00:01 +0000 ld GNU ld (GNU Binutils) 2.23.1 distcc 3.1 x86_64-pc-linux-gnu [disabled] app-shells/bash: 4.2_p45 dev-java/java-config: 2.2.0 dev-lang/python: 2.7.5, 3.2.5, 3.3.2 dev-util/cmake: 2.8.11::kde dev-util/pkgconfig: 0.28 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.11.8 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.13, 2.69 sys-devel/automake: 1.9.6-r3, 1.11.6, 1.12.6, 1.13.2 sys-devel/binutils: 2.23.1 sys-devel/gcc: 4.5.4, 4.6.3, 4.7.3 sys-devel/gcc-config: 1.8 sys-devel/libtool: 2.4.2 sys-devel/make: 3.82-r4 sys-kernel/linux-headers: 3.9 (virtual/os-headers) sys-libs/glibc: 2.17 Repositories: gentoo sunrise x-personal kde sabayon niftyrepo Installed sets: @system ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=native -mtune=native -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions /usr/share/themes/oxygen-gtk/gtk-2.0 /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -march=native -mtune=native -pipe" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs candy config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news noclean parallel-fetch preserve-libs protect-owned sandbox sfperms strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userpriv" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j9" PKGDIR="/usr/portage/bin" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise /usr/portage/local/personal /usr/portage/local/layman/kde /usr/portage/local/layman/sabayon /usr/portage/local/layman/niftyrepo" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="7zip X a52 aac aalib acl acpi addressbook akonadi alsa amd64 amr archive asf attica audiofile avahi avi bash-completion berkdb bluetooth boost branding browserplugin btrfs bzip2 cairo calendar canberra canvas cdaudio cdda cddb cdparanoia cdr cjk cleartype cli consolekit cracklib crypt cryptsetup css cups cxx dbus declarative designer-plugin desktopglobe dirac divx4linux djvu dlloader dlna dri drm dts dv dvb dvd dvdr dvdread ebook editor emboss encode exif exiv2 fam fat ffmpeg firefox fits flac flash fontconfig foomatic-db fortran freetype frei0r ftp fuse gallium gcj gd gdbm geoip geolocation gif gimp git gles glib glut gmp gphoto2 gpm gps gpu gsm gstreamer gtk gtk2 htmlhandbook iconv icu id3 id3tag imagemagick imlib ipv6 ithreads jack java java6 javascript jdbc jingle jit jpeg jpeg2k kde kexi kipi kontact kpathsea ladspa lame laptop latex lcd lcms ldap lensfun libass libnotify libsamplerate lm_sensors logrotate mad marble matroska mbox mdadm memlimit messenger mhash mime mmx mmxext mng modules mozilla mp3 mp4 mpeg mpeg2 mplayer msn mtp mudflap multilib musicbrainz mysql mysqli ncurses nepomuk network networkmanager nfs nls nocd nptl nsplugin ntfs obex offensive ogg ogm opencv opengl openmp optimized-qmake otr pam pango pcmcia pcre pdf pdflib perl phonon php plasma plotutils plugins png policykit posix ppds prison private-headers ps pulseaudio python qml qt qt3support qt4 quicktime rdesktop rdp readline recode reiser4 reiserfs remote reports rrdtool rss ruby samba scanner sdl semantic-desktop session shout skins skype slp smp sms smtp sndfile snmp sockets socks5 solver sox speex spell sql sqlite srt sse sse2 sse3 sse4 sse4_1 sse4_2 ssl ssse3 startup-notification stats stream svg swat tcpd telepathy theora threads thumbnail tidy tiff timidity tls tools truetype twitter udev udisks unicode upnp upower usb v4l v4l2 vaapi vcd vdpau vhosts visualization vlm vnc vorbis vpx webdav webinterface webkit wifi wireshark wlm wma wxwidgets wxwindows x264 xattr xcb xcomposite xfs xine xinerama xml xml2 xmp xrandr xscreensaver xulrunner xv xvid xvmc zeroconf zip zlib" ABI_X86="64" ALSA_CARDS="intel8x0 intel8x0m hda-intel usb-audio" APACHE2_MODULES="actions access_compat alias auth_basic authn_alias authn_anon authn_core authn_dbm authn_default authn_file authz_core authz_dbm authz_default authz_groupfile authz_host authz_owner auth_digest authn_dbd authz_user autoindex cache cache_disk cgi deflate dir disk_cache env slotmem_shm expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif socache_shmcb speling status reqtimeout lbmethod_byrequests unique_id unixd usertrack vhost_alias proxy proxy_fcgi proxy_http proxy_balancer lbmethod_bytraffic" APACHE2_MPMS="event" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="*" COLLECTD_PLUGINS="aggregation apache battery conntrack contextswitch cpu cpufreq csv curl curl_json curl_xml dbi df disk dns entropy ethstat exec filecount fscache hddtemp interface ipmi iptables irq libvirt load logfile match_regex match_timediff match_value md memory mysql netlink nfs notify_email ntpd nut openvpn ping powerdns processes protocols rrdtool rrdcached sensors swap syslog table tail tcpconns thermal threshold unixsock uptime users varnish vmem wireless" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="coreboot efi-64 emu multiboot pc qemu" INPUT_DEVICES="evdev keyboard mouse joystick synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer pdfimport wiki-publisher" LINGUAS="el gr en_GB en el en_US el_GR" LIRC_DEVICES="audio audio_alsa kworld all" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="development php5-3 php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby19" USERLAND="GNU" VIDEO_CARDS="nouveau i965 intel nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON # emerge -pqv '=app-admin/keepass-2.22' [ebuild N ] app-admin/keepass-2.22 USE="-aot"
Created attachment 350544 [details] build.log
Which version of libpng is installed ?
(In reply to Rafał Mużyło from comment #2) > Which version of libpng is installed ? On my main system slots 0 (version 1.6.2) and 1.2 (version 1.2.50): # eix -e libpng [I] media-libs/libpng Available versions: (1.2) 1.2.50 (0) 1.5.13-r1 1.5.15 (~)1.6.2(0/16) (1.5) (~)1.5.15-r15 (~)1.5.16 {apng neon static-libs} Installed versions: 1.2.50(1.2)(09:39:13 PM 06/09/2013) 1.6.2(08:21:58 PM 05/12/2013)(apng static-libs -neon) On the other system, only slot 0 (version 1.6.2). I just emerged slot 1.5 (version 1.5.16) but keepass still fails to emerge.
It works fine with libpng-1.5.15:0 here, what version of libgdiplus are you using? I'm using dev-dotnet/libgdiplus-2.10.9.
(In reply to Alessandro Di Federico from comment #4) > It works fine with libpng-1.5.15:0 here, what version of libgdiplus are you > using? I'm using dev-dotnet/libgdiplus-2.10.9. I am using libgdiplus-2.10.9 too. # eix -s libgdiplus [I] dev-dotnet/libgdiplus Available versions: 2.10^t 2.10.9^t {cairo} Installed versions: 2.10.9^t(05:27:00 PM 06/09/2013)(cairo) Unfortunately portage won't let me downgrade libpng:0 as the current version is required by many packages (cairo, poppler, wine, kdelibs, digikam, etc).
I can reproduce, and have libpng-1.6.2
Looks like it's a cairo bug: http://lists.cairographics.org/archives/cairo/2013-March/024162.html There's a patch here: http://lists.cairographics.org/archives/cairo/2013-March/024195.html But doesn't seem to improve the situation. I've also tried cairo-9999 without success, I'll try to come up with a stack trace and check if there's another point in the code where there's the same problem I'll open a bug upstream.
I wrote to a SUSE developer who wrote about similar problems[1], and he says someone told him that it will be fixed in libpng-1.7(?) [1]: http://lists.opensuse.org/opensuse-factory/2013-05/msg00343.html
confirm this bug
I also confirm this bug, with libpng-1.6.2
Created attachment 354042 [details] Keepass Resources PNG files corrected for >=ibpng-1.6
Comment on attachment 354042 [details] Keepass Resources PNG files corrected for >=ibpng-1.6 It's temporaly solution for this bug. Well, i open PNG files from Keepass/Resources folder and then just export them as PNG again. This new PNG files compile correct. To try this workaround you need copy archive to files folder and add «tar xf "${FILESDIR}/keepass_png_fix.tar.xz"» to src_prepare() section of ebuild. PS. This archive contains all PNG's from Keepass-2.23.
(In reply to jazzed.jazzed from comment #12) > Comment on attachment 354042 [details] > Keepass Resources PNG files corrected for >=ibpng-1.6 > > It's temporaly solution for this bug. Well, i open PNG files from > Keepass/Resources folder and then just export them as PNG again. This new > PNG files compile correct. To try this workaround you need copy archive to > files folder and add «tar xf "${FILESDIR}/keepass_png_fix.tar.xz"» to > src_prepare() section of ebuild. > PS. This archive contains all PNG's from Keepass-2.23. What tool did you use to fix the files?
(In reply to Michael Palimaka (kensington) from comment #13) > What tool did you use to fix the files? CCing the person who fixed the files so that they see this question.
> What tool did you use to fix the files? I use GIMP.
Created attachment 354156 [details] one of the offending images Attaching one of the offending images so we have something to point to when discussing the issue with upstreams.
libpng 1.6.3 has a binary called 'pngfix' to fix the IDAT lenght of .png files, which is likely the issue here too -- thus making this bug block bug 468386
(In reply to Samuli Suominen from comment #17) > libpng 1.6.3 has a binary called 'pngfix' to fix the IDAT lenght of .png > files, which is likely the issue here too -- thus making this bug block bug > 468386 I already tried the following (media-libs/libpng-1.6.3-r1): ebuild /usr/portage/app-admin/keepass/keepass-2.22.ebuild unpack find -name "*.png" | xargs -I{} pngfix -o --strip=all --out={}.fix {} find -name "*.png.fix" | xargs rename .fix "" ebuild /usr/portage/app-admin/keepass/keepass-2.22.ebuild compile Same error. Same story with imagemagick: ebuild /usr/portage/app-admin/keepass/keepass-2.22.ebuild unpack find -name "*.png" | xargs -I{} convert {} {}.fix.png ; find -name "*.fix.png" | xargs rename .fix.png ""; ebuild /usr/portage/app-admin/keepass/keepass-2.22.ebuild compile Honestly I find strange that re-saving the images with GIMP it works (but it does, also on my side), the bug seemed related to how libpng is invoked.
(In reply to Alessandro Di Federico from comment #18) > Honestly I find strange that re-saving the images with GIMP it works (but it > does, also on my side), the bug seemed related to how libpng is invoked. hrm can you try media-gfx/pngcrush with USE="-system-libs" if that is capable of fixing 'em too? this was the recommendation from libpng upstream before the `pngfix` binary came along
(In reply to Alessandro Di Federico from comment #18) > Honestly I find strange that re-saving the images with GIMP it works (but it > does, also on my side), the bug seemed related to how libpng is invoked. It is strange, I also tried a variety of tools without success. Upstream[1] thinks it could be a code error, and openSUSE suspects[2] cairo could be the culprit (however I have seen other mono packages failing in the same way, so it could be mono or libgdiplus). Someone else also said it will be resolved with libpng-1.7, but did not say why. [1]: http://thread.gmane.org/gmane.comp.graphics.png.devel/6146/focus=6147 [2]: http://lists.opensuse.org/opensuse-factory/2013-05/msg00343.html
(In reply to Samuli Suominen from comment #19) > can you try media-gfx/pngcrush with USE="-system-libs" if that is capable of > fixing 'em too? this was the recommendation from libpng upstream before the > `pngfix` binary came along Same results with a plain call to pngcrush. If you have to suggest any parameters, let me know. I've also tried the following configuration: - dev-lang/mono-3.2.0 (dotnet overlay) - media-libs/libpng-1.7.0_beta16 (custom ebuild) - x11-libs/cairo-9999 - dev-dotnet/libgdiplus-2.10.9-r1 (dotnet overlay), also with -cairo (which does not really remove the cairo dependency) Always the same error. I'll attach gdb and see if I'am able to come up with a patch (probably for cairo).
OK, I've found the problem, or at least a solution: looks like libpng/cairo/whoever doesn't like PNGs without alpha channel. # file Resources/Images/B16x16_Imp_SafeWallet.png Resources/Images/B16x16_Imp_SafeWallet.png: PNG image data, 16 x 16, 8-bit/color RGB, non-interlaced Add alpha channel: find Resources/Images/ -name "*.png" | xargs -I{} pngcrush -ow -c 6 {} And get: # file Resources/Images/B16x16_Imp_SafeWallet.png Resources/Images/B16x16_Imp_SafeWallet.png: PNG image data, 16 x 16, 8-bit/color RGBA, non-interlaced Now it works. As strace showed me, only PNGs in KeePass/Resources/Images give problems, the others work fine. So, resgen2 dies with the image as is and `pngcrush -c 4`, the other options for "-c" (i.e. 0, 2) work but the image is degraded (e.g. grayscale). I'm not completely sure the problem is the alpha channel, since some other RGB images work (e.g. KeePass/Resources/Nuvola_Client/C67_Certificate.png). Now, is this a solution? Can we add pngcrush as a build-time dependency? Should we deliver fixed images as patch? # equery g media-gfx/pngcrush-1.7.57 * dependency graph for media-gfx/pngcrush-1.7.57 `-- media-gfx/pngcrush-1.7.57 amd64 `-- media-libs/libpng-1.6.3-r1 (>=media-libs/libpng-1.5) ~amd64 `-- sys-libs/zlib-1.2.8-r1 (sys-libs/zlib) ~amd64 `-- app-arch/xz-utils-5.0.4-r1 (app-arch/xz-utils) amd64 I'm going to file a bug upstream to see if they can release PNGs without this issue, even if I think the problem is with cairo using libpng in a wrong way, leading to wrong results in certain occasions.
Reported upstream: https://sourceforge.net/p/keepass/bugs/1168/
Created attachment 361560 [details, diff] Draft patch for keepass-2.22.ebuild to include fixed PNGs Let the ebuild download and extract an archive from upstream with fixed PNGs.
I've added a patch for the 2.22 ebuild which fetches and uncompress the fixed images from upstream. This patch does not work on 2.23 since two images seem to have the same issue: KeePass/Resources/Nuvola_Derived/B16x16_Folder_2.png KeePass/Resources/Nuvola_Derived/B16x16_EditCopyUrl.png Reported upstream, waiting for a new version of the fixed images. Hopefully next releases will have images fixed out of the box.
Created attachment 361652 [details, diff] Patch for keepass-2.22.ebuild to include fixed PNGs This patch uses a new version of the archive from upstream, including the necessary images for 2.23. It makes both 2.22 and 2.23 compile.
@proxy-maintainers, I am out of action at the moment, would you mind committing this? Alessandro's patch will apply to the current ebuild, turning it into a version bump for keepass-2.23.
+ 23 Oct 2013; Tom Wijsman <TomWij@gentoo.org> +keepass-2.23.ebuild, + metadata.xml: + Version bump to 2.23, fixes bug #472764 and bug #486936. Still has an + unhandled exception when closing the window that still needs to be resolved, + see bug #489120.
Forgot something... Added "Proxied commit for Alessandro Di Federico." to the ChangeLog. Thank you for your contribution.
Fixed upstream in 2.24: https://bugs.gentoo.org/show_bug.cgi?id=490818