Please provide as much of the following information as you can, as applicable to the issue being reported. Naturally, not all information is relevant to every issue, but the more information we have to start, the better!
Environment Information
Feel free to skip this if the issue is related to documentation, a feature request, or general discussion.
- What platform are you using? (please provide specific distribution/version in summary)
- 32 and/or 64 bit?
- What build system are you using?
- Can you provide a sample netCDF file or
C code to recreate the issue?
Summary of Issue
Recent 4.4.1-RC crashes with HDF4, HDF5 files
Steps to reproduce the behavior
First let me say that things work more or less as expected/intended with NCO and RC2 on netCDF4 files. Second, I have not updated the underlying HDF4/5 libraries. That said:
NCO fails in nc_inq_varid() when reading HDF4 files. The failures seemed to be caused by changes to 4.4.1 development between 20160212 and 20160514 (i.e., things were working fine until I installed RC2).
It seems to happen on all HDF4 files, and results in
zender@frazil:~/nco/data$ ncks -m hdf.hdf
ERROR: nco_inq_varid() reports requested variable "date_int" is not defined in file
nco_err_exit(): ERROR Short NCO-generated message (usually name of function that triggered error): nco_inq_varid()
nco_err_exit(): ERROR Error code is -49. Translation into English with nc_strerror(-49) is "NetCDF: Variable not found"
nco_err_exit(): ERROR NCO will now exit with system call exit(EXIT_FAILURE)
ncdump does not seem to have any problems with HDF4 files (NCO ncks -m does lots of calls that ncdump does not do).
Also, the (lack of) an _NCProperties attribute in HDF5 files seems to cause unhappiness when opening such files. ncdump also has problems opening HDF5 files. here's what ncdump used to do (before 4.4.1-RC2) on small HDF5 test file:
zender@grele:~$ ncdump -h /home/zender/data/hdf/tdset.h5
netcdf tdset {
dimensions:
phony_dim_0 = 10 ;
phony_dim_1 = 20 ;
phony_dim_2 = 30 ;
variables:
int dset1(phony_dim_0, phony_dim_1) ;
double dset2(phony_dim_2, phony_dim_1) ;
}
Now it gives this:
zender@frazil:~/nco/data$ ncdump -h /home/zender/data/hdf/tdset.h5
netcdf tdset {
dimensions:
phony_dim_0 = 10 ;
phony_dim_1 = 20 ;
phony_dim_2 = 30 ;
variables:
NetCDF: Invalid dimension ID or name
Location: file ncdump.c; line 1697
int dset1(
ncks on the same file, with RC2, implicates _NCProperties code:
zender@frazil:~/nco/data$ ncks -m /home/zender/data/hdf/tdset.h5
HDF5-DIAG: Error detected in HDF5 (1.8.15-patch1) thread 0:
#000: ../../src/H5Adeprec.c line 243 in H5Aopen_name(): can't open attribute: '_NCProperties'
major: Attribute
minor: Can't open object
#1: ../../src/H5Aint.c line 451 in H5A_open_by_name(): unable to load attribute info from object header
major: Attribute
minor: Unable to initialize object
#2: ../../src/H5Oattribute.c line 537 in H5O_attr_open_by_name(): can't locate attribute: '_NCProperties'
major: Attribute
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (1.8.15-patch1) thread 0:
#000: ../../src/H5Adeprec.c line 243 in H5Aopen_name(): can't open attribute: '_NCProperties'
major: Attribute
minor: Can't open object
#1: ../../src/H5Aint.c line 451 in H5A_open_by_name(): unable to load attribute info from object header
major: Attribute
minor: Unable to initialize object
#2: ../../src/H5Oattribute.c line 537 in H5O_attr_open_by_name(): can't locate attribute: '_NCProperties'
major: Attribute
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (1.8.15-patch1) thread 0:
#000: ../../src/H5Adeprec.c line 243 in H5Aopen_name(): can't open attribute: '_NCProperties'
major: Attribute
minor: Can't open object
#1: ../../src/H5Aint.c line 451 in H5A_open_by_name(): unable to load attribute info from object header
major: Attribute
minor: Unable to initialize object
#2: ../../src/H5Oattribute.c line 537 in H5O_attr_open_by_name(): can't locate attribute: '_NCProperties'
major: Attribute
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (1.8.15-patch1) thread 0:
#000: ../../src/H5Adeprec.c line 243 in H5Aopen_name(): can't open attribute: '_NCProperties'
major: Attribute
minor: Can't open object
#1: ../../src/H5Aint.c line 451 in H5A_open_by_name(): unable to load attribute info from object header
major: Attribute
minor: Unable to initialize object
#2: ../../src/H5Oattribute.c line 537 in H5O_attr_open_by_name(): can't locate attribute: '_NCProperties'
major: Attribute
minor: Object not found
dset1: type NC_INT, 2 dimensions, 0 attributes, compressed? no, chunked? no, packed? no
dset1 size (RAM) = 10_20_sizeof(NC_INT) = 200*4 = 800 bytes
dset1 dimension 0: phony_dim_0, size = 10 (Non-coordinate dimension)
dset1 dimension 1: phony_dim_1, size = 20 (Non-coordinate dimension)
HDF5-DIAG: Error detected in HDF5 (1.8.15-patch1) thread 0:
#000: ../../src/H5Adeprec.c line 243 in H5Aopen_name(): can't open attribute: '_NCProperties'
major: Attribute
minor: Can't open object
#1: ../../src/H5Aint.c line 451 in H5A_open_by_name(): unable to load attribute info from object header
major: Attribute
minor: Unable to initialize object
#2: ../../src/H5Oattribute.c line 537 in H5O_attr_open_by_name(): can't locate attribute: '_NCProperties'
major: Attribute
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (1.8.15-patch1) thread 0:
#000: ../../src/H5Adeprec.c line 243 in H5Aopen_name(): can't open attribute: '_NCProperties'
major: Attribute
minor: Can't open object
#1: ../../src/H5Aint.c line 451 in H5A_open_by_name(): unable to load attribute info from object header
major: Attribute
minor: Unable to initialize object
#2: ../../src/H5Oattribute.c line 537 in H5O_attr_open_by_name(): can't locate attribute: '_NCProperties'
major: Attribute
minor: Object not found
dset2: type NC_DOUBLE, 2 dimensions, 0 attributes, compressed? no, chunked? no, packed? no
dset2 size (RAM) = 30_20_sizeof(NC_DOUBLE) = 600*8 = 4800 bytes
dset2 dimension 0: phony_dim_2, size = 30 (Non-coordinate dimension)
dset2 dimension 1: phony_dim_1, size = 20 (Non-coordinate dimension)
Environment Information
configure)Ccode to recreate the issue?Summary of Issue
Recent 4.4.1-RC crashes with HDF4, HDF5 files
Steps to reproduce the behavior
First let me say that things work more or less as expected/intended with NCO and RC2 on netCDF4 files. Second, I have not updated the underlying HDF4/5 libraries. That said:
NCO fails in nc_inq_varid() when reading HDF4 files. The failures seemed to be caused by changes to 4.4.1 development between 20160212 and 20160514 (i.e., things were working fine until I installed RC2).
It seems to happen on all HDF4 files, and results in
zender@frazil:~/nco/data$ ncks -m hdf.hdf
ERROR: nco_inq_varid() reports requested variable "date_int" is not defined in file
nco_err_exit(): ERROR Short NCO-generated message (usually name of function that triggered error): nco_inq_varid()
nco_err_exit(): ERROR Error code is -49. Translation into English with nc_strerror(-49) is "NetCDF: Variable not found"
nco_err_exit(): ERROR NCO will now exit with system call exit(EXIT_FAILURE)
ncdump does not seem to have any problems with HDF4 files (NCO ncks -m does lots of calls that ncdump does not do).
Also, the (lack of) an _NCProperties attribute in HDF5 files seems to cause unhappiness when opening such files. ncdump also has problems opening HDF5 files. here's what ncdump used to do (before 4.4.1-RC2) on small HDF5 test file:
zender@grele:~$ ncdump -h /home/zender/data/hdf/tdset.h5
netcdf tdset {
dimensions:
phony_dim_0 = 10 ;
phony_dim_1 = 20 ;
phony_dim_2 = 30 ;
variables:
int dset1(phony_dim_0, phony_dim_1) ;
double dset2(phony_dim_2, phony_dim_1) ;
}
Now it gives this:
zender@frazil:~/nco/data$ ncdump -h /home/zender/data/hdf/tdset.h5
netcdf tdset {
dimensions:
phony_dim_0 = 10 ;
phony_dim_1 = 20 ;
phony_dim_2 = 30 ;
variables:
NetCDF: Invalid dimension ID or name
Location: file ncdump.c; line 1697
int dset1(
ncks on the same file, with RC2, implicates _NCProperties code:
zender@frazil:~/nco/data$ ncks -m /home/zender/data/hdf/tdset.h5
HDF5-DIAG: Error detected in HDF5 (1.8.15-patch1) thread 0:
#000: ../../src/H5Adeprec.c line 243 in H5Aopen_name(): can't open attribute: '_NCProperties'
major: Attribute
minor: Can't open object
#1: ../../src/H5Aint.c line 451 in H5A_open_by_name(): unable to load attribute info from object header
major: Attribute
minor: Unable to initialize object
#2: ../../src/H5Oattribute.c line 537 in H5O_attr_open_by_name(): can't locate attribute: '_NCProperties'
major: Attribute
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (1.8.15-patch1) thread 0:
#000: ../../src/H5Adeprec.c line 243 in H5Aopen_name(): can't open attribute: '_NCProperties'
major: Attribute
minor: Can't open object
#1: ../../src/H5Aint.c line 451 in H5A_open_by_name(): unable to load attribute info from object header
major: Attribute
minor: Unable to initialize object
#2: ../../src/H5Oattribute.c line 537 in H5O_attr_open_by_name(): can't locate attribute: '_NCProperties'
major: Attribute
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (1.8.15-patch1) thread 0:
#000: ../../src/H5Adeprec.c line 243 in H5Aopen_name(): can't open attribute: '_NCProperties'
major: Attribute
minor: Can't open object
#1: ../../src/H5Aint.c line 451 in H5A_open_by_name(): unable to load attribute info from object header
major: Attribute
minor: Unable to initialize object
#2: ../../src/H5Oattribute.c line 537 in H5O_attr_open_by_name(): can't locate attribute: '_NCProperties'
major: Attribute
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (1.8.15-patch1) thread 0:
#000: ../../src/H5Adeprec.c line 243 in H5Aopen_name(): can't open attribute: '_NCProperties'
major: Attribute
minor: Can't open object
#1: ../../src/H5Aint.c line 451 in H5A_open_by_name(): unable to load attribute info from object header
major: Attribute
minor: Unable to initialize object
#2: ../../src/H5Oattribute.c line 537 in H5O_attr_open_by_name(): can't locate attribute: '_NCProperties'
major: Attribute
minor: Object not found
dset1: type NC_INT, 2 dimensions, 0 attributes, compressed? no, chunked? no, packed? no
dset1 size (RAM) = 10_20_sizeof(NC_INT) = 200*4 = 800 bytes
dset1 dimension 0: phony_dim_0, size = 10 (Non-coordinate dimension)
dset1 dimension 1: phony_dim_1, size = 20 (Non-coordinate dimension)
HDF5-DIAG: Error detected in HDF5 (1.8.15-patch1) thread 0:
#000: ../../src/H5Adeprec.c line 243 in H5Aopen_name(): can't open attribute: '_NCProperties'
major: Attribute
minor: Can't open object
#1: ../../src/H5Aint.c line 451 in H5A_open_by_name(): unable to load attribute info from object header
major: Attribute
minor: Unable to initialize object
#2: ../../src/H5Oattribute.c line 537 in H5O_attr_open_by_name(): can't locate attribute: '_NCProperties'
major: Attribute
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (1.8.15-patch1) thread 0:
#000: ../../src/H5Adeprec.c line 243 in H5Aopen_name(): can't open attribute: '_NCProperties'
major: Attribute
minor: Can't open object
#1: ../../src/H5Aint.c line 451 in H5A_open_by_name(): unable to load attribute info from object header
major: Attribute
minor: Unable to initialize object
#2: ../../src/H5Oattribute.c line 537 in H5O_attr_open_by_name(): can't locate attribute: '_NCProperties'
major: Attribute
minor: Object not found
dset2: type NC_DOUBLE, 2 dimensions, 0 attributes, compressed? no, chunked? no, packed? no
dset2 size (RAM) = 30_20_sizeof(NC_DOUBLE) = 600*8 = 4800 bytes
dset2 dimension 0: phony_dim_2, size = 30 (Non-coordinate dimension)
dset2 dimension 1: phony_dim_1, size = 20 (Non-coordinate dimension)