Opened 14 years ago

Closed 14 years ago

Last modified 10 years ago

#2941 closed defect (fixed)

HDF5 driver easily confused about datatypes

Reported by: warmerdam Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: HDF5


gdalinfo -checksum  HDF5:"groups.h5"://MyGroup/dset1

produces valgrind errors indicating memory corruption. It appears to be due to 32bit integer data being misclassified as 16bit.

A similar problem occurs on 64bit platforms with u64be.h5 being misclassified as 32bit integer.

I presume this problem has existed as long as the hdf5 driver.

Attachments (2)

groups.h5 (9.6 KB ) - added by warmerdam 14 years ago.
first error demonstrating data.
u64be.h5 (2.2 KB ) - added by warmerdam 14 years ago.
64bit data demonstrating problem.

Download all attachments as: .zip

Change History (5)

by warmerdam, 14 years ago

Attachment: groups.h5 added

first error demonstrating data.

by warmerdam, 14 years ago

Attachment: u64be.h5 added

64bit data demonstrating problem.

comment:1 by warmerdam, 14 years ago

Milestone: 1.5.5
Resolution: fixed
Status: newclosed

I have patched this in trunk (r16746), 1.6 (r16747) and 1.5 (r16748). The changes properly treat INT and UINT as 32bit, and decide based on sizeof(long) whether LONG is 32bit (usable) or 64bit (unusable for now). The container dataset object was also changed to not list subdatasets that are of unsupported types (though a debug message is issued).

Ideally at some point we would change the driver to convert unsupported datatypes to supported datatypes.

comment:2 by Even Rouault, 14 years ago

In r16751, I changed the expected checksum due to that fix.

comment:3 by Even Rouault, 10 years ago

Milestone: 1.5.5

Milestone 1.5.5 deleted

Note: See TracTickets for help on using tickets.