Bug report #17058

Bad_alloc error opening and geotiff saved as Float32

Added by Tres Panes over 3 years ago. Updated over 3 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Rasters
Affected QGIS version:2.18.11 Regression?:No
Operating System:Ubuntu 16.04 Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:No Copied to github as #:24957

Description

I use gdal warp to rescale raster images (http://www.gdal.org/gdalwarp.html). If I save any image with datatype Float32 i get an error when importing the file to qgis. If I save in Float64 it works without a problem. Other programs are however capable or reading and processing the Float32 images as well.

History

#1 Updated by Giovanni Manghi over 3 years ago

  • Status changed from Open to Feedback

On the same platform and same QGIS version I cannot replicate.
What version of GDAL your QGIS copy is compiled aganist?

Please attach a sampe input raster and the gdalwarp command you are using to tranform it to float32.

#2 Updated by Tres Panes over 3 years ago

Giovanni Manghi wrote:

On the same platform and same QGIS version I cannot replicate.
What version of GDAL your QGIS copy is compiled aganist?

Please attach a sampe input raster and the gdalwarp command you are using to tranform it to float32.

GDAL 2.2.1 (installed from source). The input file is too large to attach...so I reduced extent and resolution...and voila it works without a proble.

I played a little bit around and it turns out that I had this problem only with very large files (>1GB). Since other processes where running as well it might be a memory problem or even a storage problem. The thing is that "Bad_alloc" doesn't really tell you anything what is actually the problem. Is it worth looking into the logs next time?

#3 Updated by Giovanni Manghi over 3 years ago

Tres Panes wrote:

Giovanni Manghi wrote:

On the same platform and same QGIS version I cannot replicate.
What version of GDAL your QGIS copy is compiled aganist?

Please attach a sampe input raster and the gdalwarp command you are using to tranform it to float32.

GDAL 2.2.1 (installed from source). The input file is too large to attach...so I reduced extent and resolution...and voila it works without a proble.

I played a little bit around and it turns out that I had this problem only with very large files (>1GB). Since other processes where running as well it might be a memory problem or even a storage problem. The thing is that "Bad_alloc" doesn't really tell you anything what is actually the problem. Is it worth looking into the logs next time?

so, this happens with any float32 (and/or other types?) geotiff larger than 1gb regardless how it was created (gdalwarp or not)?

#4 Updated by Even Rouault over 3 years ago

You could try starting QGIS under gdb

gdb qgis

run

and when it crashes, type "bt" and paste the backtrace you get

Also posting the output of "gdalinfo your.tif" might help others replicating

#5 Updated by Tres Panes over 3 years ago

Even Rouault wrote:

You could try starting QGIS under gdb

gdb qgis

run

and when it crashes, type "bt" and paste the backtrace you get

Also posting the output of "gdalinfo your.tif" might help others replicating

I'm sorry, I can't replicate the issue. After cleaning the memory and increasing storage the problem does not persist anymore. I think it was most probably related to one of those too. If it happens again I will definitely try to make it better reproducible. But to this end I would close the topic.

#6 Updated by Giovanni Manghi over 3 years ago

  • Resolution set to not reproducable
  • Status changed from Feedback to Closed

Also available in: Atom PDF