Unidata / netcdf-java

The Unidata netcdf-java library
https://docs.unidata.ucar.edu/netcdf-java/current/userguide/index.html
BSD 3-Clause "New" or "Revised" License
146 stars 71 forks source link

Nullptr exception when reading bufr file #1184

Open tdrwenski opened 1 year ago

tdrwenski commented 1 year ago

When reading the embedded table in a buffer file, netcdf-java throws a nullptr exception. In addition, isBitCountOk returns false for this file, so something more may be going wrong.

Original issue text:

Hello, I am personally researching GDAS(Prepbufr) data. I obtained the GDAS - Daily BUFR Files product data for 2022 from the official website.

In the first step, I tried to parse the data through the netcdf-java tool and source code, but I encountered a roadblock. Error codes and error files are as follows: 1) error code:

image

2) error file see annex :

gdas.t00z.1bamua.tm00.bufr_d

In the second step, I re-obtained the product data in 2020, parsed the data through netcdf-java, and found that it was normal. normal file see annex : gdas.t12z.adpsfc.tm00.bufr_d.nr

In the end, after many attempts, I modified the above code and it can be parsed normally. On the one hand, I would like to ask the role of the next method? Does it not pass only when the BUFR template has nested tables? Perhaps the template has changed, but the source code has not been updated. By modifying the secondary code is my current way of solving the problem.

Originally posted by @zfy68 in https://github.com/Unidata/netcdf-java/issues/1084#issuecomment-1254349616