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

JSON parsing error panic #17

Open
Nuxij opened this issue Mar 21, 2024 · 0 comments
Open

JSON parsing error panic #17

Nuxij opened this issue Mar 21, 2024 · 0 comments

Comments

@Nuxij
Copy link

Nuxij commented Mar 21, 2024

Not sure what to do about this, how to catch it or if it's my fault

I'm talking to GPSd on another machine across an (admittedly terrible) wireless connction instead of localhost. I expect that the connection is causing split packets or something and the JSON parsing fails

GPS location updated 50.335434 -0.1409792
GPS location updated 50.3354333 -0.1409808
GPS location updated 50.3354333 -0.1409808
GPS location updated 50.3354322 -0.1409816
GPS location updated 50.3354322 -0.1409816
JSON parsing error: invalid character 's' looking for beginning of value
JSON parsing error: invalid character ':' looking for beginning of value
JSON parsing error: unexpected end of JSON input
JSON parsing error: unexpected end of JSON input
panic: runtime error: slice bounds out of range [1460:510]

goroutine 35 [running]:
bufio.(*Reader).ReadSlice(0xc000308000, 0x70?)
        C:/Program Files/Go/src/bufio/bufio.go:354 +0x225
bufio.(*Reader).collectFragments(0xc00021fe10?, 0xc5?)
        C:/Program Files/Go/src/bufio/bufio.go:454 +0x6d
bufio.(*Reader).ReadString(0x7ff679041a60?, 0x80?)
        C:/Program Files/Go/src/bufio/bufio.go:501 +0x1f
github.com/stratoberry/go-gpsd.watch(0x0?, 0xc000306000)
        C:/Users/Joe/go/pkg/mod/github.com/stratoberry/go-gpsd@v1.3.0/gpsd.go:283 +0x45
created by github.com/stratoberry/go-gpsd.(*Session).Watch in goroutine 1
        C:/Users/Joe/go/pkg/mod/github.com/stratoberry/go-gpsd@v1.3.0/gpsd.go:233 +0xae
        ```
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

1 participant