recws icon indicating copy to clipboard operation
recws copied to clipboard

Unhandled error causing panic

Open razum90 opened this issue 2 years ago • 1 comments

Hi,

I encountered the following error in my application:

panic: runtime error: invalid memory address or nil pointer dereference[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7d96d0]goroutine 59856 [running]:github.com/gorilla/websocket.(*Conn).SetPongHandler(0x0, 0xc003712960) /go/pkg/mod/github.com/gorilla/[email protected]/conn.go:1160 +0x20github.com/recws-org/recws.(*RecConn).keepAlive(0x1399a00) /go/pkg/mod/github.com/recws-org/[email protected]/recws.go:365 +0xc5github.com/recws-org/recws.(*RecConn).connect(0x1399a00) /go/pkg/mod/github.com/recws-org/[email protected]/recws.go:422 +0x3cacreated by github.com/recws-org/recws.(*RecConn).CloseAndReconnect /go/pkg/mod/github.com/recws-org/[email protected]/recws.go:64 +0x4d

Looks to happen because the error on this line is not being handled, but I might be wrong: https://github.com/recws-org/recws/blob/37f9e465dfb0a29879f4be02e694165e77cb6b8c/recws.go#L365

Any ideas how to go about this?

Thank you.

razum90 avatar Aug 07 '21 15:08 razum90

It can happens when ConnectHandler execute too long

nikepan avatar Sep 07 '22 20:09 nikepan