Comment about SVN commit 386939 (Speculative fix for a bt we received for a crash in blendOverlay())

Daniel Calviño Sánchez danxuliu at gmail.com
Fri Aug 11 20:07:32 UTC 2006


Hi,

I'm using paintIcon(int, bool) and blendOverlay(QPixmap&) methods from
TrayIcon class (http://websvn.kde.org/trunk/extragear/multimedia/amarok/src/systray.h,
http://websvn.kde.org/trunk/extragear/multimedia/amarok/src/systray.cpp)
as base code for a TrayIcon class in an application I'm developing
(also GPL, don't worry about it :) ).

I was trying the methods and suddenly a crash happened. Before
crashing, this was outputted to stderr:
Xlib: unexpected async reply (sequence 0x27e1a)!
In file kernel/qpixmap_x11.cpp, line 630: Out of memory

Line 630 is convertToImage() method in QPixmap. The following code was
added in SVN commit 386939
(http://websvn.kde.org/trunk/kdeextragear-1/amarok/src/systray.cpp?rev=386939&r1=378564&r2=386939)
to systray.cpp:
    //speculative fix for a bactrace we received
    //crash was in covertToImage() somewhere in this function
    if( sourceCropped.isNull() )
        return setPixmap( sourcePixmap );

I don't know if that speculative fix concerned to the same crash as
the one I suffered, but even with that condition the crash happened
for me anyway. Note that the crash happened using the code of
blendOverlay(QPixmap&) in my own application, NOT in Amarok. In fact,
I've never suffered that crash using Amarok ;)

However, I fixed the crash in my own application. It was related to a
threads issue. The methods were called from a thread different than
the thread that manages the event loop. After protecting the call to
paintIcon(int, bool) with kapp->lock() and kapp->unlock() everything
went fine (http://doc.trolltech.com/3.3/threads.html#7).

I don't know if it can be applicable to Amarok (as I don't know if the
crash was the same nor if it's still valid), but maybe it's useful for
you to know it :)

Regards,
Daniel



More information about the Amarok mailing list