[gdal-dev] Segmentation fault on BuildOverviews

Jon Morris Jon.Morris at jbarisk.com
Mon Jun 8 02:59:37 PDT 2020

Thanks for the quick fix Even! I'm also getting a warning that I can't find any reference to in the code. We don't get this at 2.2.0, so do you know what version dropped support for this option?

Warning 6: driver GTiff does not support creation option GDAL_CACHEMAX


From: Even Rouault <even.rouault at spatialys.com>
Sent: 08 June 2020 10:41
To: gdal-dev at lists.osgeo.org
Cc: Jon Morris <Jon.Morris at jbarisk.com>
Subject: Re: [gdal-dev] Segmentation fault on BuildOverviews


thanks for the report. I've just pushed a fix for that


> Hello all,


> I think I've found an edge case in gdal.Dataset.BuildOverviews. I'm using

> GDAL 3.0.4 and have found that some of our BuildOverviews tests were

> crashing out with a seg fault. On investigation, it seems to be when

> COMPRESS_OVERVIEW is set to LZW, the height is greater than the width, and

> the overview list is long enough that we will end up with some 1x1

> overviews. Here is a code snippet that reproduces the crash.


> from osgeo import gdal


> gdal.SetConfigOption('COMPRESS_OVERVIEW', 'LZW')


> temp_path = '/tmp/test.tif'

> drv = gdal.GetDriverByName('GTiff')

> raster_ds = drv.Create(temp_path, 5, 6, 1, gdal.GDT_Int16)

> del raster_ds


> tif = gdal.OpenEx(temp_path, gdal.GA_ReadOnly)

> tif.BuildOverviews('nearest', overviewlist=[2, 4, 8])




> The data type doesn't seem to matter (I've also tried Float32), but it seems

> that the raster dimensions are important. I couldn't get it to fail if the

> width was equal to or greater than the height.


> Thanks,


> Jon


> Jon Morris

> Software Developer


> Skype<sip:jon.morris at jbarisk.com>


> COVID-19. During the current outbreak JBA remains open for business and we

> continue to deliver our services. However, we have adopted flexible/remote

> workingas required. I will be receiving and reading email as normal but I

> may not always be available on the office number.




> statement]<https://www.jbagroup.co.uk/sites/www.jbagroup.co.uk/files/docume

> nts/15-030%20JBA%20Business%20Continuity%20Briefing%20-%20Latest.pdf>


> T +44 (0) 1756 799919

> www.jbarisk.com<http://www.jbarisk.com<http://www.jbarisk.com%3chttp:/www.jbarisk.com>>


> [Visit our website]<http://www.jbarisk.com>

> [http://www.jbagroup.co.uk/imgstore/JBA-Email-Sig-Icons-LINKEDIN.png]

> <https://www.linkedin.com/in/jon-morris-a2897b4/> [Follow us on Twitter]

> <https://twitter.com/jbarisk> Our postal address and registered office is

> JBA Risk Management Limited, 1 Broughton Park, Old Lane North, Broughton,

> Skipton, North Yorkshire BD23 3FD.


> Find out more about us here: www.jbarisk.com<http://www.jbarisk.com/<http://www.jbarisk.com%3chttp:/www.jbarisk.com/>> and

> follow us on Twitter @JBARisk<http://twitter.com/JBARisk> and

> LinkedIn<https://www.linkedin.com/company/2370847?trk=tyah&trkInfo=clickedV

> ertical%3Acompany%2CclickedEntityId%3A2370847%2Cidx%3A2-1-2%2CtarId%3A144741

> 4259786%2Ctas%3AJBA%20RISK%20MANAGEMENT>


> The JBA Group supports the JBA Trust.


> All JBA Risk Management's email messages contain confidential information

> and are intended only for the individual(s) named. If you are not the named

> addressee you should not disseminate, distribute or copy this e-mail.

> Please notify the sender immediately by email if you have received this

> email by mistake and delete this email from your system.



> JBA Risk Management Limited is registered in England, company number

> 07732946, 1 Broughton Park, Old Lane North, Broughton, Skipton, North

> Yorkshire, BD23 3FD, Telephone: +441756799919


Spatialys - Geospatial professional services


[JBA COVID-19 statement]<https://www.jbagroup.co.uk/sites/www.jbagroup.co.uk/files/documents/15-030%20JBA%20Business%20Continuity%20Briefing%20-%20Latest.pdf>
Our postal address and registered office is JBA Risk Management Limited, 1 Broughton Park, Old Lane North, Broughton, Skipton, North Yorkshire BD23 3FD.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200608/3f64e630/attachment-0001.html>

More information about the gdal-dev mailing list