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

Error opening NIDS storm track product #505

Open dopplershift opened 4 years ago

dopplershift commented 4 years ago

This NIDS product yields:

IOException sending File java.lang.ArrayIndexOutOfBoundsException: 250

when opened on thredds-test.

lesserwhirls commented 4 years ago

So we're blowing an array that has a hardcoded size, specifically the arrays that track the offsets and size of the special symbol packets:

https://github.com/Unidata/netcdf-java/blob/0fe2acf0eb246a147a45452948106db5c089d3e2/cdm/radial/src/main/java/ucar/nc2/iosp/nids/Nidsheader.java#L602-L617

From what I can understand, in this specific case we're assuming that we won't have more than 250 past locations per cell? I see a lot of hardcoded array sizes for similar tracking arrays throughout the symbology block parser, either 250, 550, or 1000.

lesserwhirls commented 4 years ago

It looks like the current limit is 250 locations in total for all storm tracks, not per storm track, and this file has 302.

dopplershift commented 4 years ago

I'm not aware of any hard limits in the spec. Would probably be best to use a proper dynamic data structure rather than allocating arrays of fixed size.