[gdal-dev] gdal_translate segfault with large netCDF

Frank Warmerdam warmerdam at pobox.com
Tue Apr 19 11:57:51 EDT 2011


On 11-04-19 05:01 AM, Josh.Vote at csiro.au wrote:
> Hi,
>
> I’m new to GDAL so please forgive any glaring ignorance J
>
> Currently I have an 8GB ER Mapper (ERS) dataset that I want to convert to a
> NetCDF file with gdal_translate which always results in a segfault when using
> the following command.
>
> gdal_translate -of netCDF input.ers output.nc
>
> Whereas translating only a small <4B subset of the dataset works fine.
>
> Now I’ve been doing a bit of reading and I know that netcdf 3.6.2 and below
> doesn’t support variables greater than 4GB however I’ve been doing the
> translations with the Debian libnetcdf6 package (which I believe includes
> netCDF 4.1.1 and running ‘ncgen –version’ confirms this). I am operating under
> the impression that netCDF 4.1.1 should be able to handle netCDF files of this
> size without trouble.
>
> Now I’ve tested gdal_translate from a variety of builds and they all produce
> the same problem

Josh,

I don't see any immediately obvious problems in the way we call the netcdf
API in netcdfdataset.cpp's CreateCopy method.  I would suggest you file a
ticket on the issue, and a developer can try to reproduce the problem.

I would like to suggest that you do a gdal_translate from a subset of the
ERS file at the bottom right corner of the source just to ensure that it
isn't a problem with reading past the 4GB mark in the ERS file.

I seem to have 3.6.3 of the netcdf library so I can't trivially check
this on my system.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list