Missing close button on AuiNotebook tab on Gentoo (wx2.9.5)

174 views
Skip to first unread message

paulc...@gmail.com

unread,
May 12, 2013, 2:14:21 AM5/12/13
to wx-u...@googlegroups.com
Hi All,
 
I got a report from one of the users about a missing close button (see the attached image) on Gentoo. I don't have access to a Gentoo install at the moment and use the same installation on Ubuntu, Fedora, and ArchLinux without any issues. The code is using svn trunk that is about a month old (so 2.9.5) with GTK2.
 
It seems like the resource is not properly loaded. Any idea why it may be not loaded or missing and how can I troubleshoot it further? Thank you.
 
Paul.
snapshot3.png

paulc...@gmail.com

unread,
May 14, 2013, 5:17:22 PM5/14/13
to wx-u...@googlegroups.com
It turned out that this issue may be related to my solution to the system/builtin libpng issue described here: https://groups.google.com/d/msg/wx-users/gCBrhjVG1XI/lbZFb5BGWlkJ.
 
The solution described in the thread was to use libpng 1.6 and configure it to use symbols with prefixes to avoid conflicts with the system libpng library, which may have a different version.
 
What I didn't realize is that libpng relies on zlib and when it's called on an image that may require some new features, it fails with "Gtk-WARNING **: Error loading icon: Failed to load image '/usr/share/icons/oxygen/22x22/actions/window-close.png': Fatal error in PNG image file: bad parameters to zlib". I unfortunately can't tell you *what* parameters are incorrect as this error (Z_STREAM_ERROR) is returned in several cases.
 
I replaced the builtin version of zlib (1.2.3) with the latest one (1.2.8) and the issue seems to be gone. For those following the discussion, there was only one fix I did to the generated Makefile as one of the files was renamed:
 
sed -i 's/gzio.c/gzlib.c/' Makefile
 
I'm updating the related ticket (http://trac.wxwidgets.org/ticket/14157) to note that zlib may need to be upgraded together with libpng.
 
Paul.

John Bowler

unread,
May 14, 2013, 11:16:08 PM5/14/13
to wx-u...@googlegroups.com
On Tuesday, May 14, 2013 2:17:22 PM UTC-7, paulc...@gmail.com wrote:
 
I replaced the builtin version of zlib (1.2.3) with the latest one (1.2.8) and the issue seems to be gone.
 
1.2.4 introduced the API inflateReset2, which is used by libpng 1.6 if available.  This causes the code inside libpng to change; if the zlib *header* says that the verson is 1.2.4 or later libpng will call inflateInit2 and inflateReset2, if the header has an earlier version number libpng will call inflateInit and inflateReset.  The final link must (I hope obviously ;-) use the code corresponding to the version of zlib.h included (well, a later version may be ok, but there is no forewards compatibility - only backwards.)
 
Nevertheless Z_STREAM_ERROR should not occur in either case; it means that zlib believes the z_stream structure has been set incorrectly.  I'd like to know if possible exactly which zlib API call returned Z_STREAM_ERROR.  The error message comes from png.c when zlib returns Z_STREAM_ERROR but doesn't set a more explicit error message.  As the comment in png.c suggests it is an internal error in libpng.
 
John Bowler jbo...@acm.org

paulc...@gmail.com

unread,
May 15, 2013, 12:18:18 AM5/15/13
to wx-u...@googlegroups.com
John:
 
>> I replaced the builtin version of zlib (1.2.3) with the latest one (1.2.8) and the issue seems to be gone.
> 1.2.4 introduced the API inflateReset2, which is used by libpng 1.6 if available. This causes the code inside libpng to change; if the zlib *header* says that the verson is 1.2.4 or later libpng will call inflateInit2 and inflateReset2, if the header has an earlier version number libpng will call inflateInit and inflateReset. The final link must (I hope obviously ;-) use the code corresponding to the version of zlib.h included (well, a later version may be ok, but there is no forewards compatibility - only backwards.)
> Nevertheless Z_STREAM_ERROR should not occur in either case; it means that zlib believes the z_stream structure has been set incorrectly. I'd like to know if possible exactly which zlib API call returned Z_STREAM_ERROR. The error message comes from png.c when zlib returns Z_STREAM_ERROR but doesn't set a more explicit error message. As the comment in png.c suggests it is an internal error in libpng.
 
Thank you for the information. I should have provided bit more details as I think what you said may explain the issue. As far as I understand, the latest Gentoo includes libpng 1.6.2 compiled against zlib 1.2.8 (both shipped as system libraries). wxwidgets uses libpng 1.6.0 (with its own symbols) with zlib 1.2.3 (with "original" symbols).
 
When the app loads builtin libpng, it also loads zlib 1.2.3. Now when GTK loads its own libpng to work with stock png images (the one that was compiled against 1.2.8), it finds zlib 1.2.3 already loaded. I unfortunately don't know what particular API call throws the error as I haven't had a chance to compile Gentoo and the issue is on user's machine.
 
Paul.
 
Reply all
Reply to author
Forward
0 new messages