Bug report #20892

QGIS crashes when I do "print (field_name)"

Added by Babacar FASSA almost 6 years ago. Updated almost 6 years ago.

Status:Rejected
Priority:High
Assignee:-
Category:Python bindings / sipify
Affected QGIS version:3.4.2 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:Yes Copied to github as #:28711

Description

Hello,

i have a problem when i run this code. Can some one help.

User Feedback

shape_boite = self.parameterAsSource(parameters, self.BOITE, context)
shape_point_technique = self.parameterAsSource(parameters, self.PT, context)
shape_cables = self.parameterAsSource(parameters, self.CABLE, context)
field_name=self.parameterAsFields(parameters, self.testfield, context)
print (field_name)

when i print field_name, qgis crached

Report Details

Crash ID: c27feb63aef8c3825e8e636c714477104066e3e8

Stack Trace

QRasterPaintEngine::penChanged :
QPainter::setPen :
QsciScintillaBase::inputMethodQuery :
QsciScintillaBase::inputMethodQuery :
QsciStyledText::text :
QsciStyledText::text :
QsciStyledText::text :
QsciStyledText::text :
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 :
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 :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.4.2-Madeira
QGIS code revision: 22034aa070
Compiled against Qt: 5.11.2
Running against Qt: 5.11.2
Compiled against GDAL: 2.3.2
Running against GDAL: 2.3.2

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

History

#1 Updated by Giovanni Manghi almost 6 years ago

  • Crashes QGIS or corrupts data changed from No to Yes
  • Priority changed from Normal to High
  • Category changed from Unknown to Python bindings / sipify
  • Subject changed from Qgis crached when i print fieldname to QGIS crashes when I do "print (field_name)"

#2 Updated by Nyall Dawson almost 6 years ago

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

Don't use "print" from a background thread - it's not thread safe. Use the feedback object instead.

#3 Updated by Babacar FASSA almost 6 years ago

Thanks you Nyall for the responds.

Also available in: Atom PDF