Crash in Qt when resizing windows

Matt Rogers mattr at kde.org
Fri Aug 25 03:33:30 BST 2006


On Thursday 24 August 2006 00:34, Simon Hausmann wrote:
> On Thursday 24. August 2006 02:48, Matt Rogers wrote:
> > Hi,
> >
> > While resizing the KDevelop main window, I've noticed that I see a lot of
> > the following in my debug output:
> >
> > QPixmap: Invalid pixmap parameters
> > QPainter::begin: Cannot paint on a null pixmap
>
> If these turn out to be the source of the problem setting a breaking in Qt
> where the warnings are might help to track down the reason. Or
> alternatively set QT_FATAL_WARNINGS=1 and continue from the core dump :)
>

I started having a similar crash in other places, so I dug around with gdb a 
bit, and here's what I found:

Using the backtrace sent in my first message as the reference point, the paint 
device in frame #5 is null, and that paint device is created up in frame #9 
by instantiating a QPainter with a QPixmap pointer as the paint device. The 
d-pointer for QPainter has both a device member and an engine member. The 
d-pointer's device member is set correctly. but the engine's paint device is 
is still set to zero, and eventually, that causes the crash. My guess is that 
the engine's paint device should be set to the same paint device that the 
QPainter holds in its d-pointer.

> > And if I resize the window vertically, then I get a crash with the
> > following backtrace:
> >
> > Using host libthread_db library "/lib64/libthread_db.so.1".
> > [Thread debugging using libthread_db enabled]
> > [New Thread 47203018661040 (LWP 27716)]
> > [New Thread 1090525504 (LWP 27745)]
> > [New Thread 1082132800 (LWP 27744)]
> > [KCrash handler]
> > #5  0x00002aee48e75359 in QX11PaintEngine::updatePen (this=0x108ed720,
> >     pen=@0x7fff6294d4d0) at painting/qpaintengine_x11.cpp:1284
> > #6  0x00002aee48e7574f in QX11PaintEngine::updateState (this=0x108ed720,
> >     state=@0x109b5f90) at painting/qpaintengine_x11.cpp:1123
>
> A valgrind log would be useful, too, for the crash.
>
> Simon

Hope this helps
-- 
Matt




More information about the kde-core-devel mailing list