adding layer with custom QgsRasterDataProvider crashes QGIS #59284
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
What is the bug or the crash?
When adding a layer with a custom QgsRasterDataProvider to the QGIS map canvas, QGIS crashes.
As a minimal example to reproduce this behaviour, I implemented a data provider that simply wraps the GDAL provider.
All the basic data reading methods (block(), sample() and identify()) work as expected, but when adding the layer to the QGIS map canvas (via iface.addRasterLayer()), it crashes QGIS with the following error.
QGIS ended unexpectedly
Report details
Python Stack Trace
Windows fatal exception: access violation
Current thread 0x00003fac (most recent call first):
Stack Trace
QgsRasterPipe::setResamplingStage :
QgsRasterPipe::QgsRasterPipe :
QgsRasterLayerRenderer::QgsRasterLayerRenderer :
QgsRasterLayer::createMapRenderer :
QgsMapRendererJob::prepareJobs :
QgsMapRendererCustomPainterJob::startPrivate :
QgsMapRendererSequentialJob::startPrivate :
QgsMapCanvas::refreshMap :
QObject::qt_static_metacall :
QTimer::timerEvent :
QObject::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QEventDispatcherWin32Private::sendTimerEvent :
QEventDispatcherWin32::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QCoreApplicationPrivate::sendPostedEvents :
qt_plugin_query_metadata :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :
QGIS Info
QGIS Version: 3.34.11-Prizren
QGIS code revision: 2904bce
Compiled against Qt: 5.15.13
Running against Qt: 5.15.13
Compiled against GDAL: 3.9.2
Running against GDAL: 3.9.2
System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.19045
Steps to reproduce the issue
Run this minimalistic code example in the QGIS Python Console.
Versions
QGIS-Version
3.34.11-Prizren
QGIS-Codeversion
2904bce
Qt-Version
5.15.13
Python-Version
3.12.6
GDAL-Version
3.9.2
PROJ-Version
9.4.0
EPSG-Registraturdatenbankversion
v11.004 (2024-02-24)
GEOS-Version
3.12.2-CAPI-1.18.2
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
BS-Version
Windows 10 Version 2009
Aktive Python-Erweiterungen
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.6
processing
2.12.99
Supported QGIS version
New profile
Additional context
No response
The text was updated successfully, but these errors were encountered: