Opened 13 years ago

Closed 12 years ago

#4047 closed defect (fixed)

gdal_translate segfault when translating ERS to NetCDF.

Reported by: JoshVote Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords: gdal_translate netcdf large segfault
Cc: Kyle Shannon

Description

Currently I have a 'large' 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 source.ers output.nc

Whereas translating small < 4GB subsets taken from various locations within the source dataset works as expected

gdal_translate -of netCDF -srcwin 0 0 100 100 source.ers output-subset.nc
gdal_translate -of netCDF -srcwin 50000 40000 100 100 source.ers output-subset.nc

It may be a red herring but the segfault ONLY occurs after an 8GB NetCDF file has been almost entirely written.

This testing has been done under Debian Squeeze with GDAL trunk (rev 22206) built from source and the NetCDF 4.1.1 libraries.

I've attached the ERS header for the dataset I am attempting to translate.

Attachments (2)

reprojected_magmap.ers (626 bytes ) - added by JoshVote 13 years ago.
ERS header of the large dataset that cannot be translted.
force-netcdf4.patch (441 bytes ) - added by JoshVote 13 years ago.
A patch for forcing the usage of NetCDF4

Download all attachments as: .zip

Change History (6)

by JoshVote, 13 years ago

Attachment: reprojected_magmap.ers added

ERS header of the large dataset that cannot be translted.

by JoshVote, 13 years ago

Attachment: force-netcdf4.patch added

A patch for forcing the usage of NetCDF4

comment:1 by JoshVote, 13 years ago

I've attached a patch (idea stolen from http://trac.osgeo.org/gdal/ticket/3166) that forces gdal to write NetCDF4 that fixes my problem but obviously forces the usage of NetCDF 4.

Whilst I don't expect this change to make it to trunk is it at all possible to specify netcdf3 or netcdf4 explicitly when specifying an output format for gdal_translate and any other gdal tools?

comment:2 by Even Rouault, 13 years ago

Cc: Kyle Shannon added

comment:3 by etourigny, 12 years ago

can you try latest trunk version, and use the option "-co FORMAT=NC4" or "-co FORMAT=NC4" option? This should resolve the problem. Support for NC4/NC4 Classic has been added in r23272. You can also use "-co COMPRESS=DEFLATE" to use compression.

comment:4 by etourigny, 12 years ago

Resolution: fixed
Status: newclosed

this issue should be resolved when using FORMAT=NC4 or FORMAT=NC4C creation option, closing for lack of user input.

Note: See TracTickets for help on using tickets.