Bug report #12009

Creating new QgsComposerHtml from Python causes segmentation fault

Added by Giovanni Allegri about 9 years ago. Updated almost 9 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Python plugins
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:20212

Description

The QgsComposerHtml class behaves bad from Python.
When a new QgsComposerHtml is instantiated I get a segmentation fault and QGIS crashes.
Something wrong happens even when one tries to obtain an existing object from a composition:

mycomp.getComposerItemById('myhtml') -> QgsComposerFrame instance

I don't understand how a QgsComposerFrame is returned given that QgsComposerHtml is not related to this class. It derives from QgsComposerMultiFrame, and in case it can contains frame objects...

It happens both on 2.6 and master, both on Linux and Windows.

Associated revisions

Revision 0c5352fa
Added by Martin Dobias almost 9 years ago

Remove invalid/crashing QgsComposerHtml constructor (fixes #12009)

History

#1 Updated by Giovanni Allegri about 9 years ago

I've noticed this line: https://github.com/qgis/QGIS/blob/master/src/core/composer/qgscomposerhtml.cpp#L89
It passes a null QgsComposition pointer to QgsComposerMultiFrame constructor, but within its constructor it doesn't check the pointer from not being null: https://github.com/qgis/QGIS/blob/master/src/core/composer/qgscomposermultiframe.cpp#L27

The crash happens here.

#3 Updated by Giovanni Manghi almost 9 years ago

  • Priority changed from Normal to High

#4 Updated by Martin Dobias almost 9 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF