Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QgsHistoryProviderRegistry signals crash when receivers are connected #58012

Open
2 tasks done
bogind opened this issue Jul 8, 2024 · 1 comment
Open
2 tasks done
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption PyQGIS Related to the PyQGIS API

Comments

@bogind
Copy link

bogind commented Jul 8, 2024

What is the bug or the crash?

If a receiver function is connected to QgsHistoryProviderRegistry either for the entryAdded or entryUpdated signals, when the next entry is added/updated via running a processing algorithm QGIS hangs than crashes.

Tested with functions that use the entries as well very simple (print("entry added")) functions, the crash happens every time.

Crash report:

Report Details

Python Stack Trace

Windows fatal exception: access violation

Current thread 0x0000feb4 (most recent call first):
  File "C:\OSGeo4W/apps/qgis-ltr/./python/plugins\processing\gui\AlgorithmDialog.py", line 299 in on_complete
    QgsGui.historyProviderRegistry().updateEntry(self.history_log_id, self.history_details)
  File "C:\OSGeo4W/apps/qgis-ltr/./python/plugins\processing\tools\general.py", line 204 in execAlgorithmDialog
    dlg.exec_()
  File "C:\OSGeo4W/apps/qgis-ltr/./python/plugins\processing\ProcessingPlugin.py", line 552 in _execute_history_commands
    exec(commands)

Stack Trace


pdal::FixedPointTable::`vftable' :
PyInit_sip :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
QObject::qt_static_metacall :
QgsHistoryProviderRegistry::entryUpdated :
QgsHistoryProviderRegistry::updateEntry :
PyInit__gui :
PyLong_FromString :
PyObject_Vectorcall :
PyObject_Vectorcall :
PyEval_EvalFrameDefault :
PyFunction_Vectorcall :
PyObject_Call :
PyObject_Call :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
QObject::qt_static_metacall :
QgsProcessingAlgRunnerTask::executed :
QgsProcessingAlgRunnerTask::finished :
pdal::PointView::table :
QgsTaskManager::taskStatusChanged :
QObject::qt_static_metacall :
QgsTask::statusChanged :
QgsTask::processSubTasksForCompletion :
QObject::event :
pdal::PointView::table :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QCoreApplicationPrivate::sendPostedEvents :
qt_plugin_query_metadata :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QDialog::exec :
PyInit_QtWidgets :
PyLong_FromString :
PyObject_Vectorcall :
PyObject_Vectorcall :
PyEval_EvalFrameDefault :
PyType_CalculateMetaclass :
PyEval_EvalCode :
PyMem_RawWcsdup :
Py_SourceAsString :
PyRun_StringFlags :
PyObject_CallMethodObjArgs :
PyObject_CallMethodObjArgs :
PyEval_EvalFrameDefault :
PyFunction_Vectorcall :
PyArg_CheckPositional :
PyObject_Call :
PyObject_Call :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
QObject::qt_static_metacall :
QgsProcessingHistoryProvider::executePython :
QgsProcessingHistoryProvider::createNodeForEntry :
QgsHistoryWidget::nodeDoubleClicked :
QObject::qt_static_metacall :
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 :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.34.6-Prizren
QGIS code revision: 623828f
Compiled against Qt: 5.15.13
Running against Qt: 5.15.13
Compiled against GDAL: 3.8.5
Running against GDAL: 3.8.5

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

Steps to reproduce the issue

  1. open python console
  2. run the following code:
history = QgsGui.historyProviderRegistry()

def onEntryAdded(*args):
    print("entry added!!!")


history.entryAdded.connect(onEntryAdded)
  1. Use any processing algorithm
    I used native:geometrybyexpression with a polygon geojson file input and the following expression as a test subject, but it happens with any other algorithm as well.
    'EXPRESSION':'point_n($geometry,num_points($geometry))'

Versions

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
QGIS version 3.34.6-Prizren QGIS code revision 623828f
Qt version 5.15.13
Python version 3.12.3
GDAL/OGR version 3.8.5
PROJ version 9.4.0
EPSG Registry database version v11.004 (2024-02-24)
GEOS version 3.12.1-CAPI-1.18.1
SQLite version 3.45.1
PDAL version 2.6.3
PostgreSQL client version 16.2
SpatiaLite version 5.1.0
QWT version 6.2.0
QScintilla2 version 2.14.1
OS version Windows 11 Version 2009
       
Active Python plugins
example_plugin 0.1
pluginbuilder3 3.2.1
plugin_reloader 0.9.3
QuickOSM 2.2.3
db_manager 0.1.20
grassprovider 2.12.99
MetaSearch 0.3.6
processing 2.12.99
QGIS version 3.34.6-Prizren QGIS code revision [623828f](https://github.com/qgis/QGIS/commit/623828f5) Qt version 5.15.13 Python version 3.12.3 GDAL/OGR version 3.8.5 PROJ version 9.4.0 EPSG Registry database version v11.004 (2024-02-24) GEOS version 3.12.1-CAPI-1.18.1 SQLite version 3.45.1 PDAL version 2.6.3 PostgreSQL client version 16.2 SpatiaLite version 5.1.0 QWT version 6.2.0 QScintilla2 version 2.14.1 OS version Windows 11 Version 2009

Active Python plugins
example_plugin
0.1
pluginbuilder3
3.2.1
plugin_reloader
0.9.3
QuickOSM
2.2.3
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.6
processing
2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@bogind bogind added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jul 8, 2024
@agiudiceandrea agiudiceandrea added PyQGIS Related to the PyQGIS API Crash/Data Corruption labels Jul 16, 2024
@hjy0713
Copy link

hjy0713 commented Oct 24, 2024

Hello, I've been having this problem lately, can you please solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption PyQGIS Related to the PyQGIS API
Projects
None yet
Development

No branches or pull requests

3 participants