You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 1, 2022. It is now read-only.
Hi,
We've found an issue when trying to read data from some particular netcdf files. We met an EOFException in the ucar.nc2.iosp.hdf5.H5header$GlobalHeap instantiation algorithm.
The bug can be reproduced with ToolsUI latest maintenance release (Version 4.6.15) and this attached netcdf file as example : SGA1-RO_-00-SRC_C_EUMT_20200704124757_G_O_20200704124200_20200704124459_O_N____.zip
When you open this file and try to NCDump tm_packets data, it will raise the following exception :
data:
java.io.EOFException
at ucar.unidata.io.RandomAccessFile.readInt(RandomAccessFile.java:1244)
at ucar.unidata.io.RandomAccessFile.readLong(RandomAccessFile.java:1325)
at ucar.nc2.iosp.hdf5.H5header.readLength(H5header.java:4950)
at ucar.nc2.iosp.hdf5.H5header$GlobalHeap.(H5header.java:4772)
at ucar.nc2.iosp.hdf5.H5header$HeapIdentifier.getHeapObject(H5header.java:4688)
at ucar.nc2.iosp.hdf5.H5header.getHeapDataArray(H5header.java:4525)
at ucar.nc2.iosp.hdf5.H5header.getHeapDataArray(H5header.java:4519)
at ucar.nc2.iosp.hdf5.H5iosp.readData(H5iosp.java:285)
at ucar.nc2.iosp.hdf5.H5iosp.readData(H5iosp.java:206)
at ucar.nc2.iosp.hdf5.H5iosp.readData(H5iosp.java:144)
at ucar.nc2.NetcdfFile.readData(NetcdfFile.java:2026)
at ucar.nc2.Variable.reallyRead(Variable.java:874)
at ucar.nc2.Variable._read(Variable.java:845)
at ucar.nc2.Variable._read(Variable.java:886)
at ucar.nc2.Variable.read(Variable.java:709)
at ucar.nc2.NetcdfFile.readSection(NetcdfFile.java:2053)
at ucar.nc2.ui.NCdumpPane$NCdumpTask.run(NCdumpPane.java:286)
at java.lang.Thread.run(Unknown Source)
The data can be read with the netcdf-C or python library. If we regenerate the netcdf file with the netcdf-C library, the generated netcdfile (with exactly the same data) will work with the java library.
Analysis and correction :
The bug seems to be linked to the ucar.nc2.iosp.hdf5.H5header$GlobalHeap instantiation algorithm which doesn't handle correctly some particular file byte structures.
After debugging, we've managed to find a fix which work with our tests and ToolsUI. I will submit the associated Pull request.
This bug happens also with Tools UI latest stable release (Version 5.3.3). I will create the associated Issue and Pull request on the other repository (Unidata/netcdf-java).
The text was updated successfully, but these errors were encountered:
…ter we met a HeapObject.id equals to 0. Otherwise, we could be at the end of the file and a EOFException will be raised. Addresses the github issue Unidata#1342.
Hi,
We've found an issue when trying to read data from some particular netcdf files. We met an EOFException in the ucar.nc2.iosp.hdf5.H5header$GlobalHeap instantiation algorithm.
The bug can be reproduced with ToolsUI latest maintenance release (Version 4.6.15) and this attached netcdf file as example :
SGA1-RO_-00-SRC_C_EUMT_20200704124757_G_O_20200704124200_20200704124459_O_N____.zip
When you open this file and try to NCDump tm_packets data, it will raise the following exception :
The data can be read with the netcdf-C or python library. If we regenerate the netcdf file with the netcdf-C library, the generated netcdfile (with exactly the same data) will work with the java library.
Analysis and correction :
The bug seems to be linked to the ucar.nc2.iosp.hdf5.H5header$GlobalHeap instantiation algorithm which doesn't handle correctly some particular file byte structures.
After debugging, we've managed to find a fix which work with our tests and ToolsUI. I will submit the associated Pull request.
This bug happens also with Tools UI latest stable release (Version 5.3.3). I will create the associated Issue and Pull request on the other repository (Unidata/netcdf-java).
The text was updated successfully, but these errors were encountered: