Crash when removing a style through the Layer Styling panel Style Manager
What is the bug or the crash?
Attempting to remove a style through the Style Manager tab of the Layer Styling panel causes QGIS to hang and/or crash.
Steps to reproduce the issue
- Add a layer to QGIS.
- Open the Layer Styling panel.
- Open the Style Manager tab.
- Add a new style using the green plus button.
- Remove the new style using the red minus button.
Versions
QGIS version 3.28.7-Firenze QGIS code revision fedae0eb52 Qt version 5.15.3 Python version 3.9.5 GDAL/OGR version 3.7.0 PROJ version 9.2.0 EPSG Registry database version v10.082 (2023-02-06) GEOS version 3.11.2-CAPI-1.17.2 SQLite version 3.41.1 PDAL version 2.5.3 PostgreSQL client version unknown SpatiaLite version 5.0.1 QWT version 6.1.6 QScintilla2 version 2.13.1 OS version Windows 10 Version 2009
Active Python plugins db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.6 processing 2.12.99 sagaprovider 2.12.99
Supported QGIS version
- [X] I'm running a supported QGIS version according to the roadmap.
New profile
- [X] I tried with a new QGIS profile
Additional context
I've tried this with GeoPackage, shapefile, and a scratch layer, in 3.28.7 and 3.30.3, on Windows and Linux, and on two separate computers. I experience similar problems in every case.
It doesn't happen 100% of the time, but maybe 90% of the time, so I think it's fairly easy to reproduce.
Stack trace:
Python Stack Trace
Windows fatal exception: access violation
Current thread 0x00003308 (most recent call first):
Stack Trace
QStandardItem::row :
QgsMapLayerStyleManagerWidget::removeStyle :
QObject::qt_static_metacall :
QAction::activate :
QAbstractButton::click :
QAbstractButton::mouseReleaseEvent :
QToolButton::mouseReleaseEvent :
QWidget::event :
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.28.7-Firenze
QGIS code revision: fedae0eb52
Compiled against Qt: 5.15.3
Running against Qt: 5.15.3
Compiled against GDAL: 3.7.0
Running against GDAL: 3.7.0
System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.19045
Somehow it hit an invalid index. Do you have other items in the style manager or only the one you are trying to delete? Some more details or a gif might help figure out things,
In this minimal example, I start with the default style, then add a single style and try to remove it. It works the first time, but crashes on the second attempt. Sometimes it works for 3 or 4 attempts and then crashes on the 5th. But it always crashes eventually.
See gif below, where it crashes on attempt #2.
This seems to occur on various machines and OSes, is anyone else able to reproduce it? Or am I cursed? 😄
It doesn't seem to occur when I add the new style through the Layers Panel context menu (right click layer>Styles>Add...). Only via the Style Manager tab.
Running into the same issue on 3.28.8. I observed the issue with raster layers and vector layers.
| QGIS version | 3.28.8-Firenze | QGIS code revision | 5ac45272b5 |
|---|---|---|---|
| Qt version | 5.15.3 | ||
| Python version | 3.10.6 | ||
| GDAL/OGR version | 3.4.1 | ||
| PROJ version | 8.2.1 | ||
| EPSG Registry database version | v10.041 (2021-12-03) | ||
| GEOS version | 3.10.2-CAPI-1.16.0 | ||
| SQLite version | 3.37.2 | ||
| PDAL version | 2.3.0 | ||
| PostgreSQL client version | unknown | ||
| SpatiaLite version | 5.0.1 | ||
| QWT version | 6.1.4 | ||
| QScintilla2 version | 2.11.6 | ||
| OS version | Linux Mint 21 | ||
| Active Python plugins | |||
| terminus_processing | 1.0.2 | ||
| MetaSearch | 0.3.6 | ||
| grassprovider | 2.12.99 | ||
| sagaprovider | 2.12.99 | ||
| db_manager | 0.1.20 | ||
| processing | 2.12.99 |
QGIS version 3.28.8-Firenze QGIS code revision [5ac45272b5](https://github.com/qgis/QGIS/commit/5ac45272b5) Qt version 5.15.3 Python version 3.10.6 GDAL/OGR version 3.4.1 PROJ version 8.2.1 EPSG Registry database version v10.041 (2021-12-03) GEOS version 3.10.2-CAPI-1.16.0 SQLite version 3.37.2 PDAL version 2.3.0 PostgreSQL client version unknown SpatiaLite version 5.0.1 QWT version 6.1.4 QScintilla2 version 2.11.6 OS version Linux Mint 21
Active Python plugins terminus_processing 1.0.2 MetaSearch 0.3.6 grassprovider 2.12.99 sagaprovider 2.12.99 db_manager 0.1.20 processing 2.12.99
I can't reproduce this on current versions -- is it still an issue?
I'm running 3.32.2 on Linux, and 3.28.10 and 3.32.2 on Windows, and I haven't experienced it with any of those, despite trying my best :)
Might be resolved?
I just tested on 3.28.10 on Linux and it is still reproducible. Any additional information i can provide?
The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue. In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue. If there is no further activity on this issue, it will be closed in a week.
While we hate to see this happen, this issue has been automatically closed because it has not had any activity in the last 42 days despite being marked as feedback. If this issue should be reconsidered, please follow the guidelines in the previous comment and reopen this issue. Or, if you have any further questions, there are also further support channels that can help you.
Hey, we provided feedback an this is still an issue