Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOFException on NCDump data #532

Closed
Mikhail-Aoun opened this issue Oct 22, 2020 · 0 comments
Closed

EOFException on NCDump data #532

Mikhail-Aoun opened this issue Oct 22, 2020 · 0 comments

Comments

@Mikhail-Aoun
Copy link

Hi,
As explained in Unidata/thredds#1342, we've found an issue when trying to read data from some particular netcdf files.
The same bug happens with Tools UI latest stable release (Version 5.3.3) and the same netcdf files as the one attached in the other issue. This time, we met an EOFException in the ucar.nc2.internal.iosp.hdf5.H5objects$GlobalHeap instantiation algorithm.

The Tools UI Exception when you open this file and try to NCDump tm_packets data is :

ubyte tm_packets(number_tm_packets=10256, *);
:long_name = "Array of TM packets";

data:
java.io.EOFException
at ucar.unidata.io.RandomAccessFile.readInt(RandomAccessFile.java:1233)
at ucar.unidata.io.RandomAccessFile.readLong(RandomAccessFile.java:1319)
at ucar.nc2.internal.iosp.hdf5.H5headerNew.readLength(H5headerNew.java:2215)
at ucar.nc2.internal.iosp.hdf5.H5objects$GlobalHeap.(H5objects.java:2631)
at ucar.nc2.internal.iosp.hdf5.H5objects$HeapIdentifier.getHeapObject(H5objects.java:2544)
at ucar.nc2.internal.iosp.hdf5.H5headerNew.getHeapDataArray(H5headerNew.java:2055)
at ucar.nc2.internal.iosp.hdf5.H5headerNew.getHeapDataArray(H5headerNew.java:2048)
at ucar.nc2.internal.iosp.hdf5.H5iospNew.readData(H5iospNew.java:338)
at ucar.nc2.internal.iosp.hdf5.H5iospNew.readData(H5iospNew.java:255)
at ucar.nc2.internal.iosp.hdf5.H5iospNew.readData(H5iospNew.java:191)
at ucar.nc2.NetcdfFile.readData(NetcdfFile.java:2110)
at ucar.nc2.Variable.reallyRead(Variable.java:761)
at ucar.nc2.Variable._read(Variable.java:731)
at ucar.nc2.Variable._read(Variable.java:773)
at ucar.nc2.Variable.read(Variable.java:597)
at ucar.nc2.NetcdfFile.readSection(NetcdfFile.java:2139)
at ucar.nc2.ui.op.NCdumpPane$NCdumpTask.run(NCdumpPane.java:330)
at java.lang.Thread.run(Unknown Source)

Analysis and correction :
As with the Unidata/thredds#1342 issue, the bug seems to be linked to the ucar.nc2.internal.iosp.hdf5.H5objects$GlobalHeap instantiation algorithm which doesn't handle correctly some particular file byte structures.
We've managed to find a similar fix which work with ToolsUI. I will submit the associated Pull request.

Mikhail-Aoun pushed a commit to Mikhail-Aoun/netcdf-java that referenced this issue Oct 22, 2020
…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#532.
lesserwhirls added a commit that referenced this issue Oct 23, 2020
lesserwhirls pushed a commit to lesserwhirls/netcdf-java that referenced this issue Oct 23, 2020
…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#532.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants