broadcast: panics in vidgrind logs
Issue #272
resolved
Roughly every minute, a panic occurs in the vidgrind logs:
2023/08/16 04:03:19 http: panic serving 127.0.0.1:52073: runtime error: invalid memory address or nil pointer dereference
goroutine 95542 [running]:
net/http.(*conn).serve.func1()
/layers/google.go.runtime/go/src/net/http/server.go:1825 +0xbf
panic({0xcbbac0, 0x14e9470})
/layers/google.go.runtime/go/src/runtime/panic.go:844 +0x258
bitbucket.org/ausocean/iotsvc/iotds.PutVariable({0xf560e8, 0xc0006dc200}, {0x0?, 0x0?}, 0xbbd5786c57, {0xc0007e41e0, 0x2b}, {0xc000603500, 0x1a37})
/layers/google.go.gomod/gopath/pkg/mod/bitbucket.org/ausocean/iotsvc@v0.16.0/iotds/variable.go:123 +0x1f9
main.saveBroadcast({0xf560e8, 0xc0006dc200}, 0xc0001d19c0, {0x0, 0x0})
/layers/google.go.appengine-gomod/srv/broadcast.go:1318 +0x133
main.performChecksInternal({0xf560e8, 0xc0006dc200}, 0xc0001d19c0, 0x52c365?, {0xf59590?, 0xc00012fc80}, {0xf56740?, 0x1538388?}, 0xe686c8, 0xe686a0, ...)
/layers/google.go.appengine-gomod/srv/broadcast.go:765 +0x5ff
main.performChecks({0xf560e8?, 0xc0006dc200?}, 0x900?, {0xf59590?, 0xc00012fc80?})
/layers/google.go.appengine-gomod/srv/broadcast.go:776 +0x9a
main.broadcastCheckHandler({0xc0002b5a3b?, 0xffffffffffffffff?}, 0xc000554300)
/layers/google.go.appengine-gomod/srv/broadcast.go:651 +0x33a
net/http.HandlerFunc.ServeHTTP(0x3e6b0cdfebb0?, {0xf55650?, 0xc00055c2a0?}, 0x40f245?)
/layers/google.go.runtime/go/src/net/http/server.go:2084 +0x2f
net/http.(*ServeMux).ServeHTTP(0x0?, {0xf55650, 0xc00055c2a0}, 0xc000554300)
/layers/google.go.runtime/go/src/net/http/server.go:2462 +0x149
net/http.serverHandler.ServeHTTP({0xc0006914a0?}, {0xf55650, 0xc00055c2a0}, 0xc000554300)
/layers/google.go.runtime/go/src/net/http/server.go:2916 +0x43b
net/http.(*conn).serve(0xc00044bd60, {0xf56190, 0xc000616060})
/layers/google.go.runtime/go/src/net/http/server.go:1966 +0x5d7
created by net/http.(*Server).Serve
/layers/google.go.runtime/go/src/net/http/server.go:3071 +0x4db
It seems that the store argument is invalid when saveBroadcast calls iotds.PutVariable. I’m not sure why.
Comments (3)
-
-
reporter Nice, approved.
-
- changed status to resolved
- Log in to comment
Yes, the second argument to PutVariable is the Store, which is nil. The problem is on line 765.
saveBroadcast(ctx, cfg, nil)
That 3rd param should not be nil.
Here is the fix: https://bitbucket.org/ausocean/vidgrind/pull-requests/268