Bug 98086 - qpixmap Out of memory - crasch app when using KSystemtray
Summary: qpixmap Out of memory - crasch app when using KSystemtray
Status: RESOLVED NOT A BUG
Alias: None
Product: kicker
Classification: Plasma
Component: systemtray (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: Aaron J. Seigo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-28 17:10 UTC by Karim Ryde
Modified: 2005-02-28 22:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karim Ryde 2005-01-28 17:10:13 UTC
Version:           3.4 (using KDE KDE 3.3.91)
Installed from:    Gentoo Packages
Compiler:          # gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/specs
Configured with: /var/tmp/portage/gcc-3.3.5-r1/work/gcc-3.3.5/configure --enable-version-specific-runtime-libs --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3.5 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5/info --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include/g++-v3 --host=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --enable-shared --enable-threads=posix --disable-libgcj --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.3.5  (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) 
OS:                Linux

Kuroo (not in KDE) seems to crash if compiled
against kde-3.4_beta , and not if compiled against kde-3.3. In fact, it seems
there's a kde bug introduced by this commit:
http://webcvs.kde.org/kdelibs/kdeui/ksystemtray.cpp?r1=1.43&r2=1.44

Here's the backtrace:
  #0  0x40c09f0b in QPixmap::convertToImage() const () from /usr/qt/3/lib/libqt-mt.so.3
  #1  0x40862d3b in KWin::setIcons(unsigned long, QPixmap const&, QPixmap const&) ()
   from /usr/kde/3.4/lib/libkdecore.so.4
  #2  0x405d62e8 in KSystemTray::setPixmap(QPixmap const&) () from /usr/kde/3.4/lib/libkdeui.so.4
  #3  0x08058697 in kuroo::systrayAnimation(int, QString) ()
  #4  0x080596c5 in kuroo::qt_invoke(int, QUObject*) ()
  #5  0x40cad43d in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
  #6  0x0808ebec in MyDialog2b::emerging(int, QString) ()

and the error before the crash:
  In file kernel/qpixmap_x11.cpp, line 631: Out of memory
Comment 1 Lubos Lunak 2005-02-01 16:32:33 UTC
It seems the application either causes memory corruption or provides an invalid pixmap. Please report the problem to the application developer.
Comment 2 Karim Ryde 2005-02-09 12:02:27 UTC
I'm the developer.
What leads you to these conclusions?
The apps works ok in KDE-3.3.2 but crasches in KDE-3.4_beta1.
checkpng says pixmaps are ok.
Maybe it's memory corruption...
Comment 3 Lubos Lunak 2005-02-09 13:08:21 UTC
Checkpng checks the images on the disk. By invalid pixmap I meant QPixmap object that the application passes to the function. And since the linked CVS commit is fairly trivial I find it unlikely the problem is there. The Qt error message is most likely triggered by invalid pixmap size causing an attempt to allocate huge amount of memory.
I suggest you put some debugging code in the function added by the commit that would print information about the pixmap, or you could run you application in Valgrind to find memory corruptions.
And if it will still appear to be a KDE problem, please provide some better testcase for the problem. A frontend for something related to Gentoo packages is not something everybody can try.
Comment 4 Karim Ryde 2005-02-22 10:38:03 UTC
I will create a small app by stripping all gentoo specific code but leaving all QPixmap related stuff.

Though I wonder how this can be bugging:
...
KIconLoader *ldr = KGlobal::iconLoader();
pxKuroo = ldr->loadIcon("kuroo", KIcon::NoGroup, KIcon::SizeSmallMedium, KIcon::DefaultState, NULL, true);
pxEmerging = ldr->loadIcon("kuroo1", KIcon::NoGroup, KIcon::SizeSmallMedium, KIcon::DefaultState, NULL, true);
m_systemTray->setPixmap( pxKuroo );
....

(And I've tested different groups too...)

Do you know if the pixmaps must be present in all sizes?
I have them now like:
hi16-app-kuroo.png, hi32-app-kuroo.png, hi16-app-kuroo1.png, hi32-app-kuroo1.png
Comment 5 Karim Ryde 2005-02-28 22:51:52 UTC
Bug in the app were due to corrupted stack.
KSystemtray was not at fault.