qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.52k stars 2.99k forks source link

Merge Selected Features crashes on Temporary Scratch Layers #54856

Closed rgreenwood closed 1 year ago

rgreenwood commented 1 year ago

What is the bug or the crash?

Using the Merge Selected Features on a Temporary Scratch Layer causes QGIS 3.32.x to crash (close after a brief delay). The problem does not exist in QGIS 3.28. The problem occurs on linestring and polygon layers (haven't tested on other layer types). The problem occurs in data that has been pasted from PostGIS and geopkg layers (haven't tested other sources). If all fields are removed from the pasted layer before attempting to merge features is does not crash.

Steps to reproduce the issue

  1. Unzip this test4.gpkg.zip file which contains a gpkg that has four linestrings with a single attribute named "fid". Open the gpkg.
  2. Control-A Select all features
  3. Control-C copy all the features
  4. Edit > Paste Features As > Temporary Scratch Layer (named "Pasted")
  5. select "Pasted" layer and make it editable
  6. Control-A Select all features on "Pasted" layer
  7. click the Merge Selected Features tool
  8. QGIS 3.32 closes / crashes

Versions

Works in 3.28 Fails in version below

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

QGIS version | 3.32.3-Lima | QGIS code revision | 67d46100b5 -- | -- | -- | -- Qt version | 5.15.3 Python version | 3.10.12 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 | 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1) SpatiaLite version | 5.0.1 QWT version | 6.1.4 QScintilla2 version | 2.11.6 OS version | Linux Mint 21.2   |   |   |   Active Python plugins qgis2wegue | 1.1.1 debug_vs | 0.8 plugin_reloader | 0.9.3 AnotherDXF2Shape | 1.3.1 qgsAzimuth | 0.9.16 ImportPhotos | 3.0.5 splitmultipart | 1.0.0 MemoryLayerSaver | 5.0.1 latlontools | 3.6.15 processing | 2.12.99 MetaSearch | 0.3.6 grassprovider | 2.12.99 db_manager | 0.1.20 QGIS version 3.32.3-Lima QGIS code revision [67d46100b5](https://github.com/qgis/QGIS/commit/67d46100b5) Qt version 5.15.3 Python version 3.10.12 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 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1) SpatiaLite version 5.0.1 QWT version 6.1.4 QScintilla2 version 2.11.6 OS version Linux Mint 21.2 Active Python plugins qgis2wegue 1.1.1 debug_vs 0.8 plugin_reloader 0.9.3 AnotherDXF2Shape 1.3.1 qgsAzimuth 0.9.16 ImportPhotos 3.0.5 splitmultipart 1.0.0 MemoryLayerSaver 5.0.1 latlontools 3.6.15 processing 2.12.99 MetaSearch 0.3.6 grassprovider 2.12.99 db_manager 0.1.20 ### Supported QGIS version - [X] I'm running a supported QGIS version according to [the roadmap](https://www.qgis.org/en/site/getinvolved/development/roadmap.html#release-schedule). ### New profile - [X] I tried with a new [QGIS profile](https://docs.qgis.org/latest/en/docs/user_manual/introduction/qgis_configuration.html#working-with-user-profiles) ### Additional context _No response_
Antoviscomi commented 1 year ago

Sorry @rgreenwood , I can't reproduce here, as you can see in attached screencast, all works as expected.

Video del 05-10-2023 16:52:42.webm

I'm working on Ubuntu server 22.04 LTS

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

Versione di QGIS | 3.32.3-Lima | Revisione codice QGIS | 67d46100b5 -- | -- | -- | -- Versione Qt | 5.15.3 Versione Python | 3.10.12 Versione GDAL/OGR | 3.4.1 Versione PROJ | 8.2.1 Versione database del Registro EPSG | v10.041 (2021-12-03) Compilato con GEOS | 3.10.2-CAPI-1.16.0 | Esecuzione con GEOS | 3.11.1-CAPI-1.17.1 Versione SQLite | 3.37.2 Versione PDAL | 2.3.0 Versione client PostgreSQL | 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1) Versione SpatiaLite | 5.0.1 Versione QWT | 6.1.4 Versione QScintilla2 | 2.11.6 Versione SO | Ubuntu 22.04.3 LTS   |   |   |   Plugins Python attivi pg_metadata | 1.2.2 SwapVectorDirection | 0.9 easy_labeling | 1.1 lizmap | 3.17.1 webmap_utilities | 0.1 path_sorting | 0.3 DataPlotly | 4.0.3 e_tracability | 0.7 ORStools | 1.6.0 profiletool | 4.2.6 Cluster-Analysis-plugin-main | 1.0.1 go2streetview | 8.6 clusterpoints | 6.1 line_profile | 3.1.2 processing_saga_nextgen | 1.0.0 dissect_dissolve_overlaps | 0.3 pg_raster_import | 3.2.0 corrector_vector | 0.3.1 BoundingBox | 2.1 db-style-manager | 0.8 StreetView | 3.2 HouseNumbering3 | version 0.0.5 MultiJoin | 1.0 quick_map_services | 0.19.33 RenameField | 0.1 Qgis2threejs | 2.7.1 postgis_geoprocessing | 0.9 DAI | 0.1 profileexport | 0.5.1 CalculateGeometry | 0.6.9 citygen | 0.3 splitmultipart | 1.0.0 pgRoutingLayer | 3.0.2 ProcessX | 1.5 qquake | 1.5 DeepLearningTools | 0.2.0 QuickOSM | 2.2.3 veloroutes_voies_vertes | 1.0.0 tile_index_generator | 1.0 qgis_resource_sharing | 1.0.0 pluginbuilder3 | 3.2.1 realcentroid | 1.0.3 gribdownloader | 0.5 GeometryShapes | 0.7 PostGISQueries | 0.2 xplan-umring | 2.3.3 timemanager | 3.6 OSMDownloader | 1.0.3 openlayers_plugin | 2.0.0 QuickWKT | 3.1 plugin_reloader | 0.9.3 postgis_toolbox | 1.1 grassprovider | 2.12.99 processing | 2.12.99 db_manager | 0.1.20
Antoviscomi commented 1 year ago

@rgreenwood look at the type, your gpkg contain 4 MultiLineString type not LineString type ;-)

rgreenwood commented 1 year ago

@Antoviscomi thanks for looking at it. I am aware that the layer is a multi, as are the polygon layers that also crash.

rgreenwood commented 1 year ago

@Antoviscomi I watched your screencast again and I believe you created a new temporary scratch layer, then pasted the features into it. That is not what I am doing. I select the features, copy them and then go to the Edit menu > Paste Features > Temporary Scratch Layer. The keyboard shortcut Ctrl-Alt-V does the same thing.

The layer is automatically created with the correct type (multi-linestring) and coord system (epsg:2242). I make it editable and select all features, then click the Merge Selected Features button, then crash.

Antoviscomi commented 1 year ago

@Antoviscomi I watched your screencast again and I believe you created a new temporary scratch layer, then pasted the features into it. That is not what I am doing. I select the features, copy them and then go to the Edit menu > Paste Features > Temporary Scratch Layer. The keyboard shortcut Ctrl-Alt-V does the same thing.

The layer is automatically created with the correct type (multi-linestring) and coord system (epsg:2242). I make it editable and select all features, then click the Merge Selected Features button, then crash.

@rgreenwood I'm sorry, I misunderstood this step, So I confirm the issue

Video del 06-10-2023 09:18:03.webm