Bug report #19554

QGIS don't like print() - Statements in Processing plugin

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

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

Description

User Feedback

QGIS don't like print("abc") - Statements in my Processing plugin

Report Details

Crash ID: 2ff0f4e1d6bebc384fef9db4f389363c652392af

Stack Trace

QsciLexerMakefile::qt_static_metacall :
QsciLexerMakefile::qt_static_metacall :
QsciLexerMakefile::qt_static_metacall :
QsciLexerMakefile::qt_static_metacall :
QsciScintillaBase::inputMethodQuery :
PyInit_Qsci :
QWidget::event :
QFrame::event :
PyInit_Qsci :
QCoreApplicationPrivate::sendThroughObjectEventFilters :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QWidgetPrivate::drawWidget :
QApplication::windowIcon :
QWidget::event :
QMainWindow::event :
QgisApp::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QCoreApplicationPrivate::sendPostedEvents :
qt_plugin_query_metadata :
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

History

#1 Updated by Michael Kuerbs over 6 years ago

  • Assignee deleted (Victor Olaya)

#2 Updated by Nyall Dawson over 6 years ago

  • Resolution set to wontfix
  • Status changed from Open to Closed

Correct - it's not thread safe, so calling from a processing algorithm results in a crash. Use the thread safe QgsMessageLog instead, or better yet report feedback messages using the feedback object passed to your algorithm. Then they'll be correctly logged and shown to users.

Also available in: Atom PDF