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.61k stars 3.01k forks source link

Running model freezes QGIS #45685

Closed gioman closed 2 years ago

gioman commented 3 years ago

What is the bug or the crash?

While testing for https://github.com/qgis/QGIS/issues/45676

I discovered that (at least) with the attached project/data

https://github.com/qgis/QGIS/files/7419765/contourtest.zip

and the attached model

https://github.com/qgis/QGIS/files/7424186/contours_from_text_dem.zip

running the model on QGIS 3.22/master (on Windows) leads to a complete freeze. The model runs fine on 3.16.12.

Not sure if is related or not but on a new QGIS profile on 3.22/master, "add model to toolbox" won't result in the model being added to Processing, not even after a restart (works fine on 3.16.12).

Steps to reproduce the issue

See above.

Versions

3.22 and master from osgeo4w on Windows 10.

Supported QGIS version

New profile

Additional context

Due to the seriousness of this bug (if confirmed) I would appreciate if others can check so to exclude a local issue.

nicogodet commented 3 years ago

I can confirm both issues on 3.22 windows

ulmi commented 3 years ago

I can confirm the issue on windows, with 3.22 from osgeo4w on Windows 10. The model freezes upon running it.

On linux (mint 20.2) with 3.22, the model runs with no issue.

Not sure if is related or not but on a new QGIS profile on 3.22/master, "add model to toolbox" won't result in the model being added to Processing, not even after a restart (works fine on 3.16.12).

Also there is a bug, not sure if reported already, related with adding models to the processing toolbox, on Windows and on Linux.

gioman commented 3 years ago

Thanks @ulmi @nicogodet Let's wait and see if the two issues are related before splitting the ticket.

nicogodet commented 3 years ago

Opening the model, convert it to python script and it runs smoothly.

gioman commented 3 years ago

Opening the model, convert it to python script and it runs smoothly.

Confirmed here too.

nicogodet commented 3 years ago

I can crash Linux with a model invoking a gdal alg too.

alexbruy commented 3 years ago

IMHO, there are two different issues here. First is one is about QGIS freezes/crash when executing a model containing GDAL algorithms. This happens only with GDAL algorithms and only on Windows. Most likely this is because of the changes in the way how GDAL algorithms are called (via QgsBlockingProcess).

Issue with adding a model to toolbox is not related. Moreover, I can't confirm it completely, in my tests I can't see a new model immediately after adding it, but restarting QGIS helps.

nicogodet commented 3 years ago

@alexbruy I successfully crashed QGIS on Debian. I will retry

AFAIK QgsBlockingProcess is used in 3.20 too

nyalldawson commented 3 years ago

@alexbruy

Most likely this is because of the changes in the way how GDAL algorithms are called (via QgsBlockingProcess).

I think that's unlikely -- we switched to QgsBlockingProcess in 3.18 and there's been no related bug reports in the meantime

nicogodet commented 3 years ago

@nyalldawson

there's been no related bug reports in the meantime

I think it's not true -> https://github.com/qgis/QGIS/issues/42724

alexbruy commented 3 years ago

@nyalldawson I have made such assumption because models with algorithms which use subprocess to run external tools work without any issues, while models with GDAL algorithms cause freeze.

gioman commented 3 years ago

Issue with adding a model to toolbox is not related.

@alexbruy I'm splitting the issue then.

gioman commented 3 years ago

IMHO, there are two different issues here. First is one is about QGIS freezes/crash when executing a model containing GDAL algorithms. This happens only with GDAL algorithms and only on Windows. Most likely this is because of the changes in the way how GDAL algorithms are called (via QgsBlockingProcess).

Issue with adding a model to toolbox is not related. Moreover, I can't confirm it completely, in my tests I can't see a new model immediately after adding it, but restarting QGIS helps.

@alexbruy I split the ticket here https://github.com/qgis/QGIS/issues/45730

nyalldawson commented 3 years ago

see https://github.com/qgis/QGIS/pull/45128#issuecomment-958529173 -- caused by the update to the sip library

nicogodet commented 3 years ago

Fixed in OSGeo4W v2 3.22.0-4 and 3.16.12-4