[Bug 161122] New: Plasma::Svg::Private::findInCache creates invalid pixmap and X errors when size is invalid

David Benjamin dnas.dnas at gmail.com
Mon Apr 21 20:55:17 CEST 2008


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=161122         
           Summary: Plasma::Svg::Private::findInCache creates invalid pixmap
                    and X errors when size is invalid
           Product: plasma
           Version: unspecified
          Platform: Compiled Sources
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: panel-devel kde org
        ReportedBy: dnas.dnas gmail com


Version:            (using Devel)
Installed from:    Compiled sources
OS:                Linux

(Sorry if this should have been reported to ksysguard instead; I wasn't sure.)

Steps to Reproduce:
1. Open ksysguard.
2. Switch to System Load tab

Results:
The following appears in the terminal.

QPixmap: Invalid pixmap parameters
QPainter::begin: Cannot paint on a null pixmap
QPainter::save: Painter not active
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::restore: Unbalanced save/restore
QPainter::end: Painter not active, aborted
X Error: BadValue (integer parameter out of range for operation) 2
  Major opcode: 53 (X_CreatePixmap)
  Resource id:  0x0
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 55 (X_CreateGC)
  Resource id:  0x420043c
X Error: BadGC (invalid GC parameter) 13
  Major opcode: 60 (X_FreeGC)
  Resource id:  0x420043d
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Extension:    155 (RENDER)
  Minor opcode: 4 (RenderCreatePicture)
  Resource id:  0x420043c


I've traced the problem with gdb to Plasma::Svg. Specifically, the private findInCache() method supplies a default size of QSizeF(), which constructs an invalid size. In the case when elementId is empty, this size is eventually used (after some conversions to QSize, etc.) to create a QPixmap on line 196 of kdebase/workspace/libs/plasma/svg.cpp:

p = QPixmap(s);

This results in the QPainter and QPixmap errors, and presumably the X errors at perhaps a later point (but I couldn't tell for for sure with the X errors, since they seem to be asynchronous, and I don't know how to trace those with gdb).


More information about the Panel-devel mailing list