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.59k stars 3k forks source link

QGIS crashes on MacOS 13.0 when using `fix geometries` #50888

Closed Vishu26 closed 1 year ago

Vishu26 commented 1 year ago

What is the bug or the crash?

QGIS crashes the moment I use fix geometries on a set of polygons. To be specific, the vector data format that I am using is .geojson and .shp. I also tried to use fix geometries on a single polygon, but that also crashes. Currently I am using QGIS 3.28 on MacOS 13.0.

Steps to reproduce the issue

The only step I followed is to load the .geojson or .shp file and use fix geometries in the processing toolbox.

Versions

QGIS version 3.28.0-Firenze QGIS code revision ed3ad0430f
Qt version 5.15.2
Python version 3.9.5
GDAL/OGR version 3.3.2
PROJ version 8.1.1
EPSG Registry database version v10.028 (2021-07-07)
GEOS version 3.9.1-CAPI-1.14.2
SQLite version 3.35.2
PDAL version 2.3.0
PostgreSQL client version unknown
SpatiaLite version 5.0.1
QWT version 6.1.6
QScintilla2 version 2.11.5
OS version macOS 13.0
       

Active Python plugins quick_map_services | 0.19.32 processing | 2.12.99 sagaprovider | 2.12.99 grassprovider | 2.12.99 db_manager | 0.1.20 MetaSearch | 0.3.6

QGIS version 3.28.0-Firenze QGIS code revision ed3ad0430f Qt version 5.15.2 Python version 3.9.5 GDAL/OGR version 3.3.2 PROJ version 8.1.1 EPSG Registry database version v10.028 (2021-07-07) GEOS version 3.9.1-CAPI-1.14.2 SQLite version 3.35.2 PDAL version 2.3.0 PostgreSQL client version unknown SpatiaLite version 5.0.1 QWT version 6.1.6 QScintilla2 version 2.11.5 OS version macOS 13.0

Active Python plugins quick_map_services 0.19.32 processing 2.12.99 sagaprovider 2.12.99 grassprovider 2.12.99 db_manager 0.1.20 MetaSearch 0.3.6

Supported QGIS version

New profile

Additional context

No response

nicogodet commented 1 year ago

You didn’t check « I tried with a new profile ». Did you try ?

Do you have a stack trace ?

Does it happen with every dataset or just two mentioned ? Share both layers of you can.

Vishu26 commented 1 year ago

I tried with different datasets and a new profile. But nothing solves the problem.

nicogodet commented 1 year ago

Could you share one of the dataset that fails ?

Vishu26 commented 1 year ago

You can take any dataset for inspection. All of them cause a crash. For example let's take a shape file from - https://www.diva-gis.org/gdata

Vishu26 commented 1 year ago

I am attaching a video of the crash.

https://user-images.githubusercontent.com/24605821/202499368-1da7b9c0-c5ed-4312-b053-a41b5cb74045.mov

nicogodet commented 1 year ago

I just tried with https://biogeo.ucdavis.edu/data/diva/adm/AFG_adm.zip No crash on Windows with 3.28.0

It could be a MacOS specific issue but I can't confirm as I don't have a Mac...

resistor4u commented 1 year ago

problem is present on three separate macs (each running 10.15.7 with QGIS 3.28.0 from standard installation). attaching here a crash log generated by one of the macs.

QGIS_2022-12-08-105033.txt

resistor4u commented 1 year ago

this may also be helpful: I tried running the same workflow from my bash terminal using QGIS internal tools. I ran,

qgis_process run native:fixgeometries --distance_units=feet --area_units=ac --ellipsoid=EPSG:7019 --INPUT=./shapefiles/510104_20211027/S_FLD_HAZ_AR.shp --METHOD=1 --OUTPUT=./shapefiles/510104_20211027/test.shp

Here's the traceback:

Traceback (most recent call last):
  File "/Applications/QGIS.app/Contents/MacOS/bin/../../Resources/python/qgis/utils.py", line 423, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/densityanalysis/__init__.py", line 3, in classFactory
    return DensityAnalysis(iface)
  File "/Users/user/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/densityanalysis/densityanalysis.py", line 21, in __init__
    self.canvas = iface.mapCanvas()
AttributeError: 'NoneType' object has no attribute 'mapCanvas'

error starting plugin: densityanalysis

----------------
Inputs
----------------

INPUT:  /Users/user/shapefiles/invalid_geometries.shp
METHOD: 1
OUTPUT: /Users/user/shapefiles/valid_geometries_test.shp

Using ellipsoid:    EPSG:7019
Using distance unit:    feet
Using area unit:    acres

Caught unhandled QgsException:  "The structured method to make geometries valid requires a QGIS build based on GEOS 3.10 or later"
nicogodet commented 1 year ago

Could have been introduced by https://github.com/qgis/QGIS/pull/50070

justinbb commented 1 year ago

The crash log indicates that the crash is due to an unhandled exception. The exception message in the traceback provided by @resistor4u indicates "The structured method to make geometries valid requires a QGIS build based on GEOS 3.10 or later". The current Mac builds use GEOS 3.9.1. There is likely no good reason for this, i.e. just a matter of coordination between the different left hands and right hands of the project to make sure that the robot that produces the Mac version has access to up-to-date packages. But isn't there an automatic process somewhere to make sure that dependencies are validated without fallible human interaction? Isn't there a build master (human or robot) to pass messages between the right hands and the left hands?

jctull commented 1 year ago

This issue occurs using 3.28.2 on MacOS 12.6.2. This is another example of the lagging Mac package making QGIS unusable on MacOS systems. Unfortunately, it is not clear if there is a maintainer on the qgis-mac-packager at this time.

justinbb commented 1 year ago

After investigation, the QGIS-Mac-Packager project is essentially abandoned, and this issue with an old GEOS is only one problem among very many. Even bigger issues are that the Mac has moved on to a new architecture (Apple Silicon / ARM), and that Qt 5 is on its way out and QGIS itself is on the verge of moving to Qt 6. The future of Mac QGIS is being actively discussed here: https://github.com/qgis/QGIS/issues/46299 and it is very promising. Working, up-to-date QGIS can be obtained using either MacPorts or Homebrew. The challenge still to be resolved is getting one of these efforts into signed, notarized binaries for easy distribution. Please, QGIS leadership, talk with people on that ticket, they're a good way along toward keeping this software viable on Mac.

agiudiceandrea commented 1 year ago

@justinbb maybe it would be more effective to share the discussion on this topic with the developers by sending a message to the qgis-developer mailing list.

zackarno commented 1 year ago

same issue on MacOS 13.2 (Q 3.28.2).

oeon commented 1 year ago

Got this on: Version 3.30.0 RC Version 3.28.4 LTR

Looks like I'll keep 3.22.16-Białowieża around as my LTR, as it's the last working version this tool's working with.

oskarlin commented 1 year ago

I have the exact problem. Running MacOS 12.6.2. It works with QGIS 3.26.3 but no later versions.

tudorbarascu commented 1 year ago

It's reproducible on Debian Bullseye also

agiudiceandrea commented 1 year ago

It's reproducible on Debian Bullseye also

@tudorbarascu, could you please provide any stacktrace or error message?

tudorbarascu commented 1 year ago

@agiudiceandrea It crashes completely so I cannot get the stacktrace (I get this in terminal if I run QGIS from there).

Warning: Qt Concurrent has caught an exception thrown from a worker thread.
This is not supported, exceptions thrown in worker threads must be
caught before control returns to Qt Concurrent.
terminate called after throwing an instance of 'QgsNotSupportedException'
Aborted

My debug environment for 3.22 has libgeos 3.10 and does not crash - I'll rebuild and get back.