gotalk icon indicating copy to clipboard operation
gotalk copied to clipboard

Heartbeat panics when connection is lost

Open berk-can opened this issue 4 years ago • 0 comments

Hi there, I am using gotalk with linux devices and we sometimes reboot these devices, and at one time we encountered an error with panic in app

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

goroutine 3183863 [running]:
github.com/rsms/gotalk.(*Sock).SendHeartbeat(0xc007e9d140, 0xc03d834c1b, 0xc001cd0dd0, 0x10, 0x10, 0x0, 0x0)
        /Users/berkcan/go/pkg/mod/github.com/rsms/[email protected]/sock.go:662 +0xd2
github.com/rsms/gotalk.(*Sock).sendHeartbeats(0xc007e9d140, 0xc0050b6720)
        /Users/berkcan/go/pkg/mod/github.com/rsms/[email protected]/sock.go:643 +0xb5
created by github.com/rsms/gotalk.(*Sock).Read
        /Users/berkcan/go/pkg/mod/github.com/rsms/[email protected]/sock.go:700 +0x8c5

Is there a way to recover from panic

berk-can avatar May 19 '21 12:05 berk-can