pebbe / zmq4

A Go interface to ZeroMQ version 4
BSD 2-Clause "Simplified" License
1.18k stars 164 forks source link

fix panic in call retry gets called after a socket has been closed and the context set to nil #178

Closed cornelk closed 3 years ago

cornelk commented 3 years ago
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x56ee34]
goroutine 22 [running]:
github.com/pebbe/zmq4.(*Context).retry(...)
    /.cache/go-mod/github.com/pebbe/zmq4@v1.2.7/errors.go:95
github.com/pebbe/zmq4.(*Socket).RecvBytes(0xc00018f3e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /.cache/go-mod/github.com/pebbe/zmq4@v1.2.7/zmq4.go:1082 +0xf4
github.com/pebbe/zmq4.(*Socket).Recv(...)
    /.cache/go-mod/github.com/pebbe/zmq4@v1.2.7/zmq4.go:1061
github.com/pebbe/zmq4.(*Socket).RecvMessage(0xc00018f3e0, 0x0, 0x2, 0x2, 0x2, 0x0, 0x0)
    /.cache/go-mod/github.com/pebbe/zmq4@v1.2.7/utils.go:115 +0x85