From kde-core-devel Fri Mar 13 14:14:33 2009 From: Aleix Pol Date: Fri, 13 Mar 2009 14:14:33 +0000 To: kde-core-devel Subject: Re: KIO::PreviewJob pixmaps + Qt4.5 crashes Message-Id: <757d9a550903130714g63507fcj5e1dcd5c46829d4a () mail ! gmail ! com> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=123695804202134 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--00163642702b50d0db046500b8a7" --00163642702b50d0db046500b8a7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Fri, Mar 13, 2009 at 2:23 PM, Maksim Orlovich wrote: > > Same happens on both systems tested, both using GNU/Linux environments. > > This > > crash happens also in dolphin (when used with the information panel, > > because > > there is a thumbnail drawn inside), same arguments workaround is > > applicable > > (--graphicssystem). > > > > Is there any additional information needed? > > #1) Well, for starters, you need to explain why in the world your > application seems to be using the raster engine and not the X11 engine. > There are absolutely no guarantees that KDE will work this way, at all, as > changing it is not behaviorally compatible. My Qt was installed using the configure command proposed by README.qt-copy. I don't have any special interest on raster in this application. > > > #2) valgrind output will say a lot more than the backtrace. I checked that, I didn't see anything relevant. I'll recheck later and send later on in case i think it is needed. > > > #3) The other response is likely right. I bet the following accesses > deleted memory with the Raster engine: > > const int w = 16, h = 16; > QRgb* data = new QRgb[w*h*4]; > std::memset(data, 0, w*h*4); > QImage* i = new QImage(data, w, h, QImage::Format_ARGB32_Premultiplied); > QPixmap p = QPixmap::fromImage(*i); > delete i; > //Do stuff with p here > > There seems to be no deep copy going on here (and coincidentally, > QImage::convertToFormat docs lie --- it doesn't always return a copy) > > Yes it is possible, but I don't know where this copy happens at all. --00163642702b50d0db046500b8a7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Fri, Mar 13, 2009 at 2:23 PM, Maksim = Orlovich <mo85@cor= nell.edu> wrote:
> Same happens on both systems tested, both using GNU/= Linux environments.
> This
> crash happens also in dolphin (when used with the information panel, > because
> there is a thumbnail drawn inside), same arguments workaround is
> applicable
> (--graphicssystem).
>
> Is there any additional information needed?

#1) Well, for starters, you need to explain why in the world your
application seems to be using the raster engine and not the X11 engine.
There are absolutely no guarantees that KDE will work this way, at all, as<= br> changing it is not behaviorally compatible.
My Qt was inst= alled using the configure command proposed by README.qt-copy. I don't h= ave any special interest on raster in this application.
=C2=A0


#2) valgrind output will say a lot more than the backtrace.
I checked that, I didn't see anything relevant. I'll recheck late= r and send later on in case i think it is needed.
=C2=A0


#3) The other response is likely right. I bet the following accesses
deleted memory with the Raster engine:

const int w =3D 16, h =3D 16;
QRgb* data =3D new QRgb[w*h*4];
std::memset(data, 0, w*h*4);
QImage* i =3D new QImage(data, w, h, QImage::Format_ARGB32_Premultiplied);<= br> QPixmap p =3D QPixmap::fromImage(*i);
delete i;
//Do stuff with p here

There seems to be no deep copy going on here (and coincidentally,
QImage::convertToFormat docs lie --- it doesn't always return a copy)

Yes it is possible, but I don't know where t= his copy happens at all.
--00163642702b50d0db046500b8a7--