What is the bug or the crash?
When creating an attribute table that's managed by the data provider on a COG raster layer, it fails with the message "GDAL error saving raster attribute table, raster attribute table could not be saved." (this might not be true of all COG layers, but that's a separate issue). This causes the list of bands to be reset, and occasionally logs the error "ERROR 10: Pointer 'hBand' is NULL in 'GDALSetDefaultRAT'." to the console. More importantly, it causes the layer to render extremely strangely, and almost looks to be reading image data from somewhere else in the program memory. See attached video for an example.
I also encountered a crash in QgsRasterLayerProperties::sync after the bands were reset, but I can't seem to reproduce it.
It's also worth noting that this does not happen with GeoTIFF layers, only COG layers.
MRE COG file:
cog_vat_bug_sample.tif
Video:
https://github.com/user-attachments/assets/43d4475f-a652-4652-8f45-dcc03dd9e25b
Steps to reproduce the issue
- Create a raster layer from a COG TIFF file
- Open the properties, go to "Attribute Tables", and click "New attribute table from current symbology"
- Observe the GDAL error, and click OK
- Try to create the attribute table again, this time using a sidecar VAT.DBF file
- This should work, now click OK
- Observe that the band list is now empty, and panning/zooming the map causes weird artifacts and visible corruption/memory issues
Versions
| QGIS version | 3.44.7-Solothurn |
| QGIS code branch | Release 3.44 |
| |
| Libraries |
| Qt version | 5.15.18 |
| Python version | 3.14.2 |
| GDAL version | 3.11.5 — Eganville |
| PROJ version | 9.6.2 |
| EPSG Registry database version | v12.013 (2025-05-26) |
| GEOS version | 3.14.1-CAPI-1.20.5 |
| SQLite version | 3.50.2 |
| PDAL version | 2.9.3 |
| PostgreSQL client version | 18.0 |
| SpatiaLite version | 5.1.0 |
| QWT version | 6.2.0 |
| QScintilla2 version | 2.14.1 |
| OS version | Fedora Linux 43 (KDE Plasma Desktop Edition) |
| |
| Active Python plugins |
| loadthemall | 3.4 |
| advanced_map_downloader | 1.0.0 |
| xyz_tiles_basemap_loader | 0.1 |
| ee_plugin | 0.1.7 |
| vrtbuilderplugin | 0.9.20210222T174536.master |
| shapefile_encoding_fixer | 0.7.1 |
| processing_saga_nextgen | 1.1.0 |
| wbt_for_qgis | 1.0.9 |
| a00_qpip | 1.4.2 |
| qraster_merge | 1.0.1 |
| MetaSearch | 0.3.6 |
| db_manager | 0.1.20 |
| grassprovider | 2.12.99 |
| processing | 2.12.99 |
Supported QGIS version
New profile
Additional context
I could reproduce this on both the Wayland and X11 QT platforms
What is the bug or the crash?
When creating an attribute table that's managed by the data provider on a COG raster layer, it fails with the message "GDAL error saving raster attribute table, raster attribute table could not be saved." (this might not be true of all COG layers, but that's a separate issue). This causes the list of bands to be reset, and occasionally logs the error "ERROR 10: Pointer 'hBand' is NULL in 'GDALSetDefaultRAT'." to the console. More importantly, it causes the layer to render extremely strangely, and almost looks to be reading image data from somewhere else in the program memory. See attached video for an example.
I also encountered a crash in
QgsRasterLayerProperties::syncafter the bands were reset, but I can't seem to reproduce it.It's also worth noting that this does not happen with GeoTIFF layers, only COG layers.
MRE COG file:
cog_vat_bug_sample.tif
Video:
https://github.com/user-attachments/assets/43d4475f-a652-4652-8f45-dcc03dd9e25b
Steps to reproduce the issue
Versions
Supported QGIS version
New profile
Additional context
I could reproduce this on both the Wayland and X11 QT platforms