Bug report #8996

Composer crashes QGIS when setComposition() method called

Added by Alexander Bruy about 11 years ago. Updated almost 11 years ago.

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

Description

When I try to set composition to composer instance, created from plugin, QGIS crashes. Sometimes composer created, but crashes on any interaction with it.

Crash dump

QGIS died on signal 11
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[New LWP 2569]
[New LWP 2565]
[New LWP 2564]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f0c352771c7 in waitpid () from /lib64/libc.so.6
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib64/libgobject-2.0.so.0.3200.4-gdb.py", line 9, in <module>
    from gobject import register
  File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in <module>
    import gdb.backtrace
ImportError: No module named backtrace
[Current thread is 1 (Thread 0x7f0c3cae87c0 (LWP 2556))]
#0  0x00007f0c352771c7 in waitpid () from /lib64/libc.so.6
No symbol table info available.
#1  0x0000000000505955 in qgisCrash (signal=<optimized out>) at /home/alex/devel/cpp/qgis/src/app/main.cpp:290
        status = <optimized out>
        pidstr = "--pid=2556\\000\\346\\377\\177\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\020\\315@\\346\\377\\177\\000" 
        gdbpid = <optimized out>
        exename = "/usr/local/bin/qgis\\000\\000\\000\\000\\000\\320\\323\\302\\001", '\\000' <repeats 12 times>, "8\\315@\\346\\377\\177\\000\\000\\000)\\352,\\f\\177\\000\\000\\022\\315@\\346\\377\\177\\000\\000\\020\\315@\\346\\377\\177\\000\\000\\300\\314@\\346\\377\\177\\000\\000\\220\\244\\303\\001\\000\\000\\000\\000Q\\275\\035\\065\\f\\177", '\\000' <repeats 14 times>"\\377, \\177\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\001\\000\\000\\000\\000\\000\\000\\000\\060\\315@\\346\\377\\177\\000\\000\\240\\244\\303\\001", '\\000' <repeats 12 times>, "0\\315@\\346\\377\\177\\000\\000\\070\\315@\\346\\377\\177\\000\\000H\\315@\\346\\377\\177\\000\\000\\020\\315@\\346\\377\\177\\000\\000@\\315@\\346\\377\\177\\000\\000 \\315@\\346\\377\\177\\000\\000\\373\\262\\035\\065\\f\\177\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\240\\244\\303\\001", '\\000' <repeats 12 times>"\\375, \\226&5\\f\\177\\000\\000P\\b\\001\\002\\000\\000\\000\\000p\\316@\\346\\377\\177\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\022\\000\\000\\000\\000\\000\\000\\000"...
        len = <optimized out>
#2  <signal handler called>
No symbol table info available.
#3  0x00007f0c37cd6d81 in QGraphicsScene::items() const () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#4  0x00007f0c38fa9764 in QgsComposerView::wheelZoom (this=this@entry=0x7c23ba0, event=event@entry=0x7fffe640dd60) at /home/alex/devel/cpp/qgis/src/gui/qgscomposerview.cpp:1319
        itemIt = <optimized out>
        wheelAction = 2
        zoomFactor = 2
        zoomIn = false
        scaleFactor = 2
        viewportRect = {x1 = 0, y1 = 0, x2 = 652, y2 = 500}
        scenePoint = {xp = -20.203389830508474, yp = -72.548536209553163}
        mySettings = <incomplete type>
        visibleRect = {xmin = -279.17411402157165, ymin = -157.03543913713403, xmax = 320.49922958397531, ymax = 303.05084745762713}
        itemList = {{p = {static shared_null = {ref = {_q_value = 8181}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0x0}, d = 0x0}}
#5  0x00007f0c38fa9a94 in QgsComposerView::wheelEvent (this=0x7c23ba0, event=0x7fffe640dd60) at /home/alex/devel/cpp/qgis/src/gui/qgscomposerview.cpp:1250
No locals.
#6  0x00007f0c377489ce in QWidget::event(QEvent*) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#7  0x00007f0c37af1626 in QFrame::event(QEvent*) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#8  0x00007f0c37d09bdb in QGraphicsView::viewportEvent(QEvent*) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#9  0x00007f0c38361c26 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib64/libQtCore.so.4
No symbol table info available.
#10 0x00007f0c376f8f2c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#11 0x00007f0c376fde7d in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#12 0x00007f0c39592a03 in QgsApplication::notify (this=0x7fffe64111e0, receiver=0x7c25e00, event=0x7fffe640dd60) at /home/alex/devel/cpp/qgis/src/core/qgsapplication.cpp:229
        done = true
#13 0x00007f0c38361abe in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQtCore.so.4
No symbol table info available.
#14 0x00007f0c3776371d in ?? () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#15 0x00007f0c37774b4e in ?? () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#16 0x00007f0c377737b1 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#17 0x00007f0c377993e2 in ?? () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#18 0x00007f0c32275c35 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#19 0x00007f0c32275f68 in ?? () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#20 0x00007f0c32276024 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#21 0x00007f0c3838fc16 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
No symbol table info available.
#22 0x00007f0c3779906e in ?? () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#23 0x00007f0c3836080f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
No symbol table info available.
#24 0x00007f0c38360a98 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
No symbol table info available.
#25 0x00007f0c37baac18 in QDialog::exec() () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#26 0x00007f0c1c1fd025 in ?? () from /usr/lib64/python2.7/site-packages/PyQt4/QtGui.so
No symbol table info available.
#27 0x00007f0c1cdfacf2 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
No symbol table info available.
#28 0x00007f0c1cdfbb48 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.7.so.1.0
No symbol table info available.
#29 0x00007f0c1cd7e916 in ?? () from /usr/lib64/libpython2.7.so.1.0
No symbol table info available.
#30 0x00007f0c1cd53a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
No symbol table info available.
#31 0x00007f0c1cd61e80 in ?? () from /usr/lib64/libpython2.7.so.1.0
No symbol table info available.
#32 0x00007f0c1cd53a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
No symbol table info available.
#33 0x00007f0c1cdf4c67 in PyEval_CallObjectWithKeywords () from /usr/lib64/libpython2.7.so.1.0
No symbol table info available.
#34 0x00007f0c1caff250 in ?? () from /usr/lib64/python2.7/site-packages/sip.so
No symbol table info available.
#35 0x00007f0c1c8240a6 in ?? () from /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so
No symbol table info available.
#36 0x00007f0c1c8243c8 in ?? () from /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so
No symbol table info available.
#37 0x00007f0c1c8244a2 in ?? () from /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so
No symbol table info available.
#38 0x00007f0c38377083 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
No symbol table info available.
#39 0x00007f0c376f2d52 in QAction::triggered(bool) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#40 0x00007f0c376f2f40 in QAction::activate(QAction::ActionEvent) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#41 0x00007f0c37b2acc3 in ?? () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#42 0x00007f0c37b30fd9 in ?? () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#43 0x00007f0c377486a0 in QWidget::event(QEvent*) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#44 0x00007f0c37b3228b in QMenu::event(QEvent*) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#45 0x00007f0c376f8f5c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#46 0x00007f0c376fdc3b in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#47 0x00007f0c39592a03 in QgsApplication::notify (this=0x7fffe64111e0, receiver=0x2598590, event=0x7fffe640fd60) at /home/alex/devel/cpp/qgis/src/core/qgsapplication.cpp:229
        done = true
#48 0x00007f0c38361abe in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQtCore.so.4
No symbol table info available.
#49 0x00007f0c376f9d9b in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#50 0x00007f0c377748dc in ?? () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#51 0x00007f0c377737b1 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#52 0x00007f0c377993e2 in ?? () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#53 0x00007f0c32275c35 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#54 0x00007f0c32275f68 in ?? () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#55 0x00007f0c32276024 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#56 0x00007f0c3838fc16 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
No symbol table info available.
#57 0x00007f0c3779906e in ?? () from /usr/lib64/libQtGui.so.4
No symbol table info available.
#58 0x00007f0c3836080f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
No symbol table info available.
#59 0x00007f0c38360a98 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
No symbol table info available.
#60 0x00007f0c38365738 in QCoreApplication::exec() () from /usr/lib64/libQtCore.so.4
No symbol table info available.
#61 0x000000000050011a in main (argc=1, argv=0x1cb0910) at /home/alex/devel/cpp/qgis/src/app/main.cpp:1021
        testFont = <incomplete type>
        qgistor = <incomplete type>
        mySnapshotHeight = 600
        args = {<QList<QString>> = {{p = {static shared_null = {ref = {_q_value = 8181}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0x1c40870}, d = 0x1c40870}}, <No data fields>}
        myApp = {<QApplication> = {<No data fields>}, static staticMetaObject = {d = {superdata = 0x7f0c381903e0 <QApplication::staticMetaObject>, stringdata = 0x7f0c3987e120 <qt_meta_stringdata_QgsApplication> "QgsApplication", data = 0x7f0c3987e180 <qt_meta_data_QgsApplication>, extradata = 0x7f0c39b4ba40 <QgsApplication::staticMetaObjectExtraData>}}, static staticMetaObjectExtraData = {objects = 0x0, static_metacall = 0x7f0c3981ab00 <QgsApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>}, static mFileOpenEventReceiver20100 = 0x1cbfae0, static mFileOpenEventList20100 = {<QList<QString>> = {{p = {static shared_null = {ref = {_q_value = 8181}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0x7f0c386bab40 <QListData::shared_null>}, d = 0x7f0c386bab40 <QListData::shared_null>}}, <No data fields>}, static mPrefixPath20100 = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x1c6d160, static codecForCStrings = 0x0}, static mPluginPath20100 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0x1c6e7e0, static codecForCStrings = 0x0}, static mPkgDataPath20100 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0x1c76060, static codecForCStrings = 0x0}, static mLibraryPath20100 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0x1c8a310, static codecForCStrings = 0x0}, static mLibexecPath20100 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0x1c762e0, static codecForCStrings = 0x0}, static mThemeName20100 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0x1cb6120, static codecForCStrings = 0x0}, static mDefaultSvgPaths20100 = {<QList<QString>> = {{p = {static shared_null = {ref = {_q_value = 8181}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0x1c79980}, d = 0x1c79980}}, <No data fields>}, static mSystemEnvVars20100 = {{d = 0x1c960a0, e = 0x1c960a0}}, static mConfigPath20100 = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x1c76250, static codecForCStrings = 0x0}, static mRunningFromBuildDir20100 = false, static mBuildSourcePath20100 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0x7f0c386bac20 <QString::shared_null>, static codecForCStrings = 0x0}, static mBuildOutputPath20100 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0x7f0c386bac20 <QString::shared_null>, static codecForCStrings = 0x0}, static mGdalSkipList20100 = {<QList<QString>> = {{p = {static shared_null = {ref = {_q_value = 8181}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0x7f0c386bab40 <QListData::shared_null>}, d = 0x7f0c386bab40 <QListData::shared_null>}}, <No data fields>}}
        myLocaleOverrideFlag = <optimized out>
        __FUNCTION__ = "main" 
        mySnapshotFileName = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x7f0c386bac00 <QString::shared_empty>, static codecForCStrings = 0x0}
        myHideSplash = false
        myRestorePlugins = true
        myTranslationCode = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x1cb0ef0, static codecForCStrings = 0x0}
        customizationfile = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x7f0c386bac20 <QString::shared_null>, static codecForCStrings = 0x0}
        style = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x1c9af60, static codecForCStrings = 0x0}
        qttor = <incomplete type>
        myPixmap = <incomplete type>
        myInitialExtent = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x1c067d0, static codecForCStrings = 0x0}
        mySettings = <incomplete type>
        i18nPath = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x1cb0b70, static codecForCStrings = 0x0}
        myLocale = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x7f0c386bac20 <QString::shared_null>, static codecForCStrings = 0x0}
        qgis = 0x1cbfae0
        retval = <optimized out>
        optionpath = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x7f0c386bac20 <QString::shared_null>, static codecForCStrings = 0x0}
        customizationsettings = <optimized out>
        systemEnvVars = {{d = 0x1c960a0, e = 0x1c960a0}}
        pythonfile = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x7f0c386bac20 <QString::shared_null>, static codecForCStrings = 0x0}
        myUseGuiFlag = <optimized out>
        myUserLocale = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x1c737a0, static codecForCStrings = 0x0}
        mySplashPath = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x1c96030, static codecForCStrings = 0x0}
        mySnapshotWidth = 800
        myCustomization = <optimized out>
        configpath = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14382}, alloc = 0, size = 0, data = 0x7f0c386bac3a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 999}, alloc = 0, size = 0, data = 0x7f0c386bac1a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x7f0c386bac20 <QString::shared_null>, static codecForCStrings = 0x0}
        useCustomVars = <optimized out>
        mypSplash = 0x1cb0910
gdb returned 0

I created simple plugin to test this. To reproduce:
  • load any layer to QGIS
  • enable test plugin (it will be added to Vector menu)
  • select layer in TOC
  • open plugin dialog and press "Test composer" button
  • new composer will be created
  • try to zoom or pan composition. QGIS crashes

This is strange, because when same code executed from QGIS Python console, all works fine and there are no crashes.

testplugin.zip - Test plugin (4 KB) Alexander Bruy, 2013-11-04 02:35 AM

Associated revisions

Revision 77a24cbe
Added by Martin Dobias almost 11 years ago

Fix #8996 (Composer crashes QGIS when setComposition() method called)

History

#1 Updated by Luigi Pirelli about 11 years ago

confirmed on master 866cee4 following proposed steps

#2 Updated by Matthias Kuhn about 11 years ago

  • Status changed from Open to Feedback

Alex, did you try to assign the composition to a class variable instead of a local variable so it does not get garbage collected at the end of the method?

#3 Updated by Alexander Bruy about 11 years ago

  • Status changed from Feedback to Closed

Thanks, Matthias! Making composition a class variable solves this issue.

#4 Updated by Martin Dobias almost 11 years ago

  • Status changed from Closed to Reopened

There is /KeepReference/ argument annotation in SIP that should take care of these cases: increase the reference count of the object, so it will not be garbage collected when the original variable gets out of scope. In PyQt4, QGraphicsView::setScene() has that annotation. It is not very nice to require users to keep a separate reference to have it working.

Maybe we should look around to see if there are more PyQGIS classes requiring such handling.

#5 Updated by Matthias Kuhn almost 11 years ago

/KeepReference/ sounds better indeed.

#6 Updated by Martin Dobias almost 11 years ago

  • Status changed from Reopened to Closed

Also available in: Atom PDF