By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 298

Summary: Libpng Warning Messages
Product: TDE Reporter: Darrell <darrella>
Component: tdebaseAssignee: Timothy Pearson <kb9vqf>
Status: RESOLVED FIXED    
Severity: normal CC: bugwatch, darrella, monqpourbsd-linuxfr
Priority: P2    
Version: 3.5.13 [Trinity]   
Hardware: All   
OS: All   
Compiler Version: TDE Version String:
Application Version: Application Name:
Attachments: Dirty libpng patch
20 repaired png files for kdebase/kicker/data/tiles

Description Darrell 2010-10-01 17:01:15 CDT
Open the Configure Panel dialog box. Select the Appearance option. The following xsession-error log messages appear immediately.

libpng warning: Ignoring gAMA chunk with gamma=0
libpng warning: Ignoring attempt to set negative chromaticity value
libpng warning: Ignoring attempt to set cHRM RGB triangle with zero area

The messages are repeatable with an existing 3.5.10 or new Trinity profile. Thus, some legacy code is causing these messages in Trinity.

The messages probably are generated by libpng libraries, but curiously only appear when opening Configure Panel Appearances.

From the context of the messages, likely something in the Trinity/KDE code is not accessing the libpng libraries correctly.
Comment 1 Darrell 2011-11-19 12:19:43 CST
Update: Bug is present in 3.5.13.
Comment 2 ammo42 2011-11-22 18:43:15 CST
Created attachment 152 [details]
Dirty libpng patch

The patch makes libpng crash at the moment of sending the first warning, so that gdb can give a bt of kcontrol.
Comment 3 ammo42 2011-11-22 18:45:38 CST
Could you try to reproduce the bug with a patched libpng ?
You would have, after replacing the libpng (which should be ABI-compatible), to
$ kcontrol
$ ps aux | grep kcontrol
$ gdb kcontrol <kcontrol's PID>
(gdb) cont
<make the action triggering the warning, which should crash kcontrol with SIGUSR1>
(gdb) bt

It would single out the faulty code.
Comment 4 Darrell 2011-12-22 21:54:24 CST
My apologies for forgetting about this. I notice all three messages are from libpng:

Ignoring gAMA chunk with gamma=0: pngrutil.c
Ignoring attempt to set negative chromaticity value: png.c
Ignoring attempt to set cHRM RGB triangle with zero area: png.c

Okay, so you know that too since you create a special patch for libpng. :)

I created and install the special patched libpng package for 13.1. I followed your instructions. The back trace was full of ?? statements and useless. So I rebuilt libpng with debug symbols.

I was unable to select Desktop/Panel/Appearance. As soon as I select Desktop/Panel everything froze. Therefore I never got to see the original three error messages.

Here is that backtrace:

=============================================================
(gdb) bt
#0  0xb5802a67 in raise () from /lib/libc.so.6
#1  0xb571804c in ?? () from /usr/lib/libpng14.so.14
#2  0xb571f52f in png_read_info () from /usr/lib/libpng14.so.14
#3  0xb612e743 in read_png_image (iio=0xbfabf07c) at kernel/qpngio.cpp:305
#4  0xb5e7d538 in QImageIO::read (this=0xbfabf07c) at kernel/qimage.cpp:4452
#5  0xb5eb3941 in QPixmap::load (this=0xbfabf160, fileName=..., format=0x0, conversion_flags=0) at kernel/qpixmap.cpp:850
#6  0xb5eb39b0 in QPixmap::load (this=0xbfabf160, fileName=..., format=0x0, mode=QPixmap::Auto) at kernel/qpixmap.cpp:887
#7  0xb5eb3d58 in QPixmap (this=0xbfabf160, fileName=..., format=0x0, mode=QPixmap::Auto) at kernel/qpixmap.cpp:306
#8  0xb5137891 in LookAndFeelTab::fillTileCombos (this=0x834dbd0) at /dev/shm/kdebase/kcontrol/kicker/lookandfeeltab_impl.cpp:328
#9  0xb51383b3 in LookAndFeelTab (this=0x834dbd0, parent=0x834d5d0, name=0x0)
    at /dev/shm/kdebase/kcontrol/kicker/lookandfeeltab_impl.cpp:69
#10 0xb514b4ce in LookAndFeelConfig (this=0x834d5d0, parent=0x834b888, name=0xb5163aa9 "kcmkicker")
    at /dev/shm/kdebase/kcontrol/kicker/lookandfeelconfig.cpp:35
#11 0xb513faa8 in create_kicker_appearance (parent=0x834b888) at /dev/shm/kdebase/kcontrol/kicker/main.cpp:410
#12 0xb717efc5 in KCModuleLoader::load (mod=..., libname=..., loader=0x80e5188, report=KCModuleLoader::Inline, parent=0x834b888,
    name=0x83531b0 "kicker_config_appearance", args=...) at /dev/shm/kdelibs/kutils/kcmoduleloader.cpp:92
#13 0xb717fa32 in KCModuleLoader::loadModule (mod=..., report=KCModuleLoader::Inline, withfallback=false, parent=0x834b888,
    name=0x83531b0 "kicker_config_appearance", args=...) at /dev/shm/kdelibs/kutils/kcmoduleloader.cpp:156
#14 0xb7196853 in KCModuleProxy::realModule (this=0x834b888) at /dev/shm/kdelibs/kutils/kcmoduleproxy.cpp:186
#15 0xb71a1389 in KCModuleContainer::addModule (this=0x8139000, module=...) at /dev/shm/kdelibs/kutils/kcmodulecontainer.cpp:153
#16 0xb513f19c in create_kicker (parent=0x0, name=0x8274de0 "kicker") at /dev/shm/kdebase/kcontrol/kicker/main.cpp:380
#17 0xb717efc5 in KCModuleLoader::load (mod=..., libname=..., loader=0x80e5188, report=KCModuleLoader::None, parent=0x0,
    name=0x8274de0 "kicker", args=...) at /dev/shm/kdelibs/kutils/kcmoduleloader.cpp:92
#18 0xb717fa32 in KCModuleLoader::loadModule (mod=..., report=KCModuleLoader::None, withfallback=true, parent=0x0, name=0x0,
    args=...) at /dev/shm/kdelibs/kutils/kcmoduleloader.cpp:156
#19 0xb7180492 in KCModuleLoader::loadModule (mod=..., withfallback=<value optimized out>, parent=0x0, name=0x0, args=...)
    at /dev/shm/kdelibs/kutils/kcmoduleloader.cpp:118
#20 0xb771bd31 in ConfigModule::module (this=0x80e4da8) at /dev/shm/kdebase/kcontrol/kcontrol/modules.cpp:72
#21 0xb770d9d6 in ModuleWidget::load (this=0x812a370, module=0x80e4da8) at /dev/shm/kdebase/kcontrol/kcontrol/dockcontainer.cpp:116
#22 0xb770dff4 in DockContainer::loadModule (this=0x814fbe0, module=0x80e4da8)
    at /dev/shm/kdebase/kcontrol/kcontrol/dockcontainer.cpp:168
#23 0xb770e3fb in DockContainer::dockModule (this=0x814fbe0, module=0x80e4da8)
    at /dev/shm/kdebase/kcontrol/kcontrol/dockcontainer.cpp:222
#24 0xb7709bce in TopLevel::activateModule (this=0x80a84d0, mod=0x80e4da8) at /dev/shm/kdebase/kcontrol/kcontrol/toplevel.cpp:426
#25 0xb770a22a in TopLevel::qt_invoke (this=0x80a84d0, _id=73, _o=0xbfabfc68)
    at /dev/shm/kdebase.build/kcontrol/kcontrol/toplevel.moc:134
#26 0xb5e9fde5 in QObject::activate_signal (this=0x812ca58, clist=0x81362c8, o=0xbfabfc68) at kernel/qobject.cpp:2383
#27 0xb770bc5c in IndexWidget::moduleActivated (this=0x812ca58, t0=0x80e4da8)
    at /dev/shm/kdebase.build/kcontrol/kcontrol/indexwidget.moc:124
=============================================================

Next I tried to start the "Configure Panel" option through the panel popup menu. The moment I selected the Appearance tab the applet froze, but I was unable to obtain any backtrace. Same useless ?? statements.

I could not again repeat the backtrace I provided.

Note: I built all TDE packages with debug support as well as libpng. I don't know why I get nothing but ?? statements.

Hopefully there is something useful in the one backtrace.

Please let me know. Thanks!
Comment 5 Darrell 2011-12-22 22:32:56 CST
I tried a different approach, starting gdb and using 'attach'. That seemed to work much better.

I used the kicker/panel popup menu to select "Configure Panel." When I selected the Appearance icon, which is where those three messages always appear, I was able to obtain this backtrace:

=============================================================
(gdb) bt
#0  0xb60bba67 in raise () from /lib/libc.so.6
#1  0xb5f9c04c in ?? () from /usr/lib/libpng14.so.14
#2  0xb5fa352f in png_read_info () from /usr/lib/libpng14.so.14
#3  0xb69b2743 in read_png_image (iio=0xbfb6651c) at kernel/qpngio.cpp:305
#4  0xb6701538 in QImageIO::read (this=0xbfb6651c) at kernel/qimage.cpp:4452
#5  0xb6737941 in QPixmap::load (this=0xbfb66600, fileName=..., format=0x0, conversion_flags=0) at kernel/qpixmap.cpp:850
#6  0xb67379b0 in QPixmap::load (this=0xbfb66600, fileName=..., format=0x0, mode=QPixmap::Auto) at kernel/qpixmap.cpp:887
#7  0xb6737d58 in QPixmap (this=0xbfb66600, fileName=..., format=0x0, mode=QPixmap::Auto) at kernel/qpixmap.cpp:306
#8  0xb3d75891 in LookAndFeelTab::fillTileCombos (this=0x8241280) at /dev/shm/kdebase/kcontrol/kicker/lookandfeeltab_impl.cpp:328
#9  0xb3d763b3 in LookAndFeelTab (this=0x8241280, parent=0x8267f90, name=0x0)
    at /dev/shm/kdebase/kcontrol/kicker/lookandfeeltab_impl.cpp:69
#10 0xb3d894ce in LookAndFeelConfig (this=0x8267f90, parent=0x82987e0, name=0xb3da1aa9 "kcmkicker")
    at /dev/shm/kdebase/kcontrol/kicker/lookandfeelconfig.cpp:35
#11 0xb3d7daa8 in create_kicker_appearance (parent=0x82987e0) at /dev/shm/kdebase/kcontrol/kicker/main.cpp:410
#12 0xb4313fc5 in KCModuleLoader::load (mod=..., libname=..., loader=0x817d418, report=KCModuleLoader::Inline, parent=0x82987e0,
    name=0xb6a8858a "unnamed", args=...) at /dev/shm/kdelibs/kutils/kcmoduleloader.cpp:92
#13 0xb4314a32 in KCModuleLoader::loadModule (mod=..., report=KCModuleLoader::Inline, withfallback=true, parent=0x82987e0,
    name=0xb6a8858a "unnamed", args=...) at /dev/shm/kdelibs/kutils/kcmoduleloader.cpp:156
#14 0xb432b853 in KCModuleProxy::realModule (this=0x82987e0) at /dev/shm/kdelibs/kutils/kcmoduleproxy.cpp:186
#15 0xb432c472 in KCModuleProxy::buttons (this=0x82987e0) at /dev/shm/kdelibs/kutils/kcmoduleproxy.cpp:603
#16 0xb4316002 in KCMultiDialog::slotAboutToShow (this=0x8252478, page=0x8296fe8) at /dev/shm/kdelibs/kutils/kcmultidialog.cpp:367
#17 0xb4319692 in KCMultiDialog::qt_invoke (this=0x8252478, _id=90, _o=0xbfb66c38)
    at /dev/shm/kdelibs.build/kutils/kcmultidialog.moc:142
#18 0xb6723de5 in QObject::activate_signal (this=0x8252478, clist=0x82434a0, o=0xbfb66c38) at kernel/qobject.cpp:2383
#19 0xb719994f in KDialogBase::aboutToShowPage (this=0x8252478, t0=0x8296fe8) at /dev/shm/kdelibs.build/kdeui/kdialogbase.moc:333
#20 0xb719a13a in KDialogBase::qt_emit (this=0x8252478, _id=20, _o=0xbfb66d58) at /dev/shm/kdelibs.build/kdeui/kdialogbase.moc:396
#21 0xb4315b70 in KCMultiDialog::qt_emit (this=0x8252478, _id=20, _o=0xbfb66d58)
    at /dev/shm/kdelibs.build/kutils/kcmultidialog.moc:159
#22 0xb6723e1e in QObject::activate_signal (this=0x8252ee8, clist=0x8256308, o=0xbfb66d58) at kernel/qobject.cpp:2381
#23 0xb71a1d4c in KJanusWidget::aboutToShowPage (this=0x8252ee8, t0=0x8296fe8) at /dev/shm/kdelibs.build/kdeui/kjanuswidget.moc:126
#24 0xb71a1ddc in KJanusWidget::qt_emit (this=0x8252ee8, _id=2, _o=0xbfb66e48) at /dev/shm/kdelibs.build/kdeui/kjanuswidget.moc:148
#25 0xb6723d9f in QObject::activate_signal (this=0x82559c0, clist=0x8256218, o=0xbfb66e48) at kernel/qobject.cpp:2405
#26 0xb6a6f474 in QWidgetStack::aboutToShow (this=0x82559c0, t0=0x8296fe8) at .moc/release-shared-mt/moc_qwidgetstack.cpp:118
#27 0xb686520a in QWidgetStack::raiseWidget (this=0x82559c0, w=0x8296fe8) at widgets/qwidgetstack.cpp:373
#28 0xb71a422d in KJanusWidget::showPage (this=0x8252ee8, w=0x8296fe8) at /dev/shm/kdelibs/kdeui/kjanuswidget.cpp:602
#29 0xb71a4638 in KJanusWidget::showPage (this=0x8252ee8, index=3) at /dev/shm/kdelibs/kdeui/kjanuswidget.cpp:588
#30 0xb71a68db in KJanusWidget::slotShowPage (this=0x8252ee8) at /dev/shm/kdelibs/kdeui/kjanuswidget.cpp:573
#31 0xb71a7a28 in KJanusWidget::qt_invoke (this=0x8252ee8, _id=47, _o=0xbfb67068)
    at /dev/shm/kdelibs.build/kdeui/kjanuswidget.moc:133
=============================================================

Hopefully there is something useful in this backtrace.

Please let me know. Thanks!
Comment 6 ammo42 2011-12-22 22:47:42 CST
The bug is caused by bogus PNG images in $PREFIX/share/apps/kicker/tiles; the one that triggers the warnings/crash in the control panel is light_green_tiny_up.png.
There are 20 bogus PNG images in this directory (measured by doing 'convert $i.png /tmp/dummy.jpg' on every image and counting SIGUSR1's).
Since I have not enough debugging symbols, I found it by stracing the program, and this PNG image was the last one before the SIGUSR1.
I think it would be wise to check every PNG file against libpng warnings...
(and for cleaning I think ImageMagick will do a good job :))
Comment 7 Darrell 2011-12-23 00:20:30 CST
Created attachment 242 [details]
20 repaired png files for kdebase/kicker/data/tiles

How did you determine that? I'd like to learn. :)

Okay, these 20 png files need to be repaired:

light_gray_large_down.png
light_gray_normal_up.png
light_green_normal_down.png
light_green_normal_up.png
light_green_tiny_down.png
light_green_tiny_up.png
light_pastel_large_down.png
light_pastel_normal_up.png
light_purple_normal_down.png
light_purple_normal_up.png
nuts_and_bolts_normal_down.png
nuts_and_bolts_normal_up.png
solid_green_normal_down.png
solid_green_normal_up.png
solid_pastel_normal_down.png
solid_pastel_normal_up.png
solid_purple_normal_down.png
solid_purple_normal_up.png
solid_tigereye_normal_down.png
solid_tigereye_normal_up.png

I converted the suspect files from png to png using convert. I then repeated your exercise to convert all files to jpg and received no error messages.

Next I repeated the exercise of selecting Configure Panel/Appearance and checked the xsession log. I saw the three error messages.

Then I copied the repaired files to /opt/trinity/share/apps/kicker/tiles and repeated the Configure Panel/Appearance exercise. No error messages!
 
I'm attaching a gzip file of the 20 repaired files.

The files need to be merged to kdebase/kicker/data/tiles.

This bug report can be closed when the repaired images are merged into the git tree. :)

Good work!
Comment 8 Timothy Pearson 2012-01-11 12:55:28 CST
Fixed in GIT hash 75aed00.  Interestingly these files were corrupt since the days of KDE 3.5.10 and this bug was never fixed.

Thanks for reporting, and for the patch!