Bug report #20044

QGIS crashes while run custom processing algorithm with a selection output

Added by Michael Kuerbs about 6 years ago. Updated about 6 years ago.

Status:Rejected
Priority:High
Assignee:-
Category:Processing/Core
Affected QGIS version:3.2.1 Regression?:No
Operating System:Win 7 Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:Yes Copied to github as #:27866

Description

User Feedback

QGIS 3 crashes when running my vector selection algorithm.
The selection was changed on screen, but but the algorithm can not finished.
Source Code is attached in file.

  1. Crash Report ####################################

Report Details

Crash ID: 206277cbb0696c518f15d17acd20aa13755f5b59

Stack Trace

QXmlStreamStringRef::~QXmlStreamStringRef :
QgsError::summary :
QgsExpressionContext::~QgsExpressionContext :
PyInit__core :
PyInit_sip :
Py_HashPointer :
PyFrame_New :
PyFunction_FastCallDict :
PyObject_CallFunctionObjArgs :
PyObject_Call :
PyInit_sip :
std::basic_string<char,std::char_traits<char>,std::allocator<char> >::shrink_to_fit :
PyInit__core :
QgsProcessingAlgorithm::runPrepared :
QgsProcessingAlgorithm::run :
PyInit__core :
PyCFunction_FastCallDict :
PyObject_GenericGetAttr :
PyEval_EvalFrameDefault :
PyErr_Occurred :
PyObject_GenericGetAttr :
PyEval_EvalFrameDefault :
PyErr_Occurred :
PyFunction_FastCallDict :
PyObject_CallFunctionObjArgs :
PyObject_Call :
PyInit_sip :
QMetaObject::activate :
QDialogButtonBox::~QDialogButtonBox :
QMetaObject::activate :
QAbstractButton::clicked :
QAbstractButton::click :
QAbstractButton::mouseReleaseEvent :
QWidget::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QApplicationPrivate::sendMouseEvent :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processMouseEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QEventDispatcherWin32::processEvents :
TranslateMessageEx :
TranslateMessage :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QDialog::exec :
PyCFunction_FastCallDict :
PyObject_GenericGetAttr :
PyEval_EvalFrameDefault :
PyFunction_FastCallDict :
PyObject_CallFunctionObjArgs :
PyObject_Call :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
QMetaObject::activate :
QAbstractItemView::doubleClicked :
QTreeView::mouseDoubleClickEvent :
QWidget::event :
QFrame::event :
QAbstractItemView::viewportEvent :
QCoreApplicationPrivate::sendThroughObjectEventFilters :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QApplicationPrivate::sendMouseEvent :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processMouseEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QEventDispatcherWin32::processEvents :
TranslateMessageEx :
TranslateMessage :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.2.1-Bonn
QGIS code revision: 1edf372fb8
Compiled against Qt: 5.9.2
Running against Qt: 5.9.2
Compiled against GDAL: 2.2.4
Running against GDAL: 2.2.4

System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 6.1.7601

algorithm_FindDuplicates.py Magnifier - Source Code (5.94 KB) Michael Kuerbs, 2018-10-08 09:49 AM

History

#1 Updated by Giovanni Manghi about 6 years ago

  • Priority changed from Normal to High
  • Subject changed from Crashed while run processing algorithm with a selection output to QGIS crashes while run custom processing algorithm with a selection output

#2 Updated by Nyall Dawson about 6 years ago

  • Resolution set to invalid
  • Status changed from Open to Rejected

Not a qgis bug - it's due to incorrect use of the API.

You are appending your scope to the expression context once per feature, which means you're transferring ownership of it multiple times. This should be done once outside the loop instead.

Also available in: Atom PDF