Bug report #17210

Can crash gdal raster calculator by using a layer that was newly created and then removed

Added by Alister Hood almost 3 years ago. Updated almost 3 years ago.

Status:Closed
Priority:High
Assignee:Victor Olaya
Category:Processing/GDAL
Affected QGIS version:2.18.13 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:25109

Description

- Open the gdal raster calculator from the processing toolbox.
- Run a calculation and don't close the raster calculator.
- Remove the output layer from the project TOC.
- Select the removed layer as an input layer and try to run another calculation: CRASH.

FWIW the most likely time someone will encounter this is if they run more than one calculation, delete some of the results layers, and then try to run another calculation using one of them. The output layers are all helpfully named "Calculated", so to make sure they select one which still exists they would need to close and then reopen the calculator.

Compare with this:

- Open the gdal raster calculator from the processing toolbox.
- Remove a pre-existing raster layer from the project TOC.
- Try to use the removed layer in the raster calculator: no crash in this case.

Tested on Windows 10, but I doubt that matters.
I haven't done any testing to determine if it is a widespread problem or just applies to the gdal raster calculator.

Associated revisions

Revision 13061251
Added by Alexander Bruy almost 3 years ago

[processing] refresh all layer selectors when layer added/removed (fix #17210)

History

#1 Updated by Giovanni Manghi almost 3 years ago

  • Priority changed from Normal to High

In other tools when a layer is removed from toc then the list of available inputs in the (open) processing tool gui is immediately updated. Maybe the gdal raster calc is missing some bit to make it work the same way?

#2 Updated by Alexander Bruy almost 3 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

#3 Updated by Giovanni Manghi almost 3 years ago

  • Resolution set to fixed/implemented

Thanks Alex!

Also available in: Atom PDF