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

Panic during network loss #163

Closed
jrick opened this issue Jul 9, 2020 · 1 comment
Closed

Panic during network loss #163

jrick opened this issue Jul 9, 2020 · 1 comment

Comments

@jrick
Copy link
Member

jrick commented Jul 9, 2020

Upon restarting my router for an upgrade I got this panic:

panic: runtime error: invalid memory address or nil pointer dereference       
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x80c70b]

goroutine 36 [running]:
github.com/companyzero/zkc/session.(*KX).Close(...)
        /home/jrick/src/zkc/session/kx.go:124
main.(*ZKC).handleRPC.func1(0xc000b911a0, 0xc000ba7030, 0xc0000e01c0, 0xc001e89808)
        /home/jrick/src/zkc/zkclient/zkclient.go:1201 +0x8b
panic(0x865ca0, 0xbb5430)
        /home/jrick/src/go/src/runtime/panic.go:975 +0x3e9
github.com/companyzero/zkc/session.(*KX).Read(...)
        /home/jrick/src/zkc/session/kx.go:414
main.(*ZKC).handleRPC(0xc0000e01c0)
        /home/jrick/src/zkc/zkclient/zkclient.go:1289 +0x172
created by main.(*ZKC).goOnlineAndPrint
        /home/jrick/src/zkc/zkclient/zkclient.go:1005 +0x1fb

This is with a slightly earlier version of my #162 PR; sorry if the line numbers don't match up exactly. I don't think the PR is necessarily related.

It seems that z.kx was nil and that it panicked twice. Once, while reading, and a second time from a deferred KX.Close call.

@jrick
Copy link
Member Author

jrick commented Jul 21, 2020

This seems definitely related to my patch. Been running with and without it, and evidence only points to the version built with my patch crashing in this manner.

@jrick jrick closed this as completed Jul 21, 2020
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