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

Crash while reading file #17

Open
landru29 opened this issue Feb 8, 2019 · 4 comments
Open

Crash while reading file #17

landru29 opened this issue Feb 8, 2019 · 4 comments

Comments

@landru29
Copy link
Collaborator

landru29 commented Feb 8, 2019

http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_1p00.pl?bottomlat=-90&dir=%2Fgfs.2019020512&file=gfs.t12z.pgrb2.1p00.f003&leftlon=0&lev_10_m_above_ground=on&rightlon=360&toplat=90&var_UGRD=on&var_VGRD=on

panic: runtime error: makeslice: len out of range

goroutine 1 [running]:
github.com/nilsmagnus/grib/griblib.ReadMessage(0x177be20, 0xc420336060, 0x0, 0x17e6fc8, 0x0)
github.com/nilsmagnus/grib/griblib/sections.go:80 +0xb4
github.com/nilsmagnus/grib/griblib.ReadMessages(0x177be20, 0xc420336060, 0xc42004f520, 0x55ec6e, 0x7fa8dea7a160, 0xc420382060, 0xc42004f520)
github.com/nilsmagnus/grib/griblib/sections.go:58 +0x9b

@landru29
Copy link
Collaborator Author

landru29 commented Feb 8, 2019

Oups!
Noaa switched to https ! the data I recieved is not grib file.
But the read should not panic, just through an error

@nilsmagnus
Copy link
Owner

Hmm, how can I reproduce this situation?

@wwek
Copy link

wwek commented Oct 1, 2019

head -n 8 gfs.t06z.pgrb2.0p50.f000 > 1.txt |cat -

--593d9cc39dbbd1cf
Content-type: text/plain; charset=UTF-8
Content-range: bytes 66461079-66628632/90829745

GRIB���
H�P�i����]J�0�]J�m��� � "Q�1�PE��

like this?

Oups!
Noaa switched to https ! the data I recieved is not grib file.
But the read should not panic, just through an error

@measuredweighed
Copy link
Contributor

We ran into this issue. I've created a pull request with a fix that appears to be working well for us.

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

4 participants