Open jimmy-moore opened 3 years ago
We already check for closed connection status on subscribe https://github.com/go-stomp/stomp/blob/master/conn.go#L597 How do you get the SSIGSEV when calling the subscribe call?
Yeah I'm not sure how it's getting it yet. I see you already check, but something doesn't seem right. I'll try to narrow down the issue...
connect use ssl and network is not good can got this panic
wait a moment afert subscribe
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x40 pc=0x1021bf13c]
goroutine 1 [running]:
github.com/go-stomp/stomp/v3.(*Conn).createAckNackFrame(0x140001666c0?, 0x14000119f60?, 0x1?)
/Volumes/DATA/Runtimes/GoPATH/pkg/mod/github.com/go-stomp/stomp/v3@v3.0.5/conn.go:723 +0x7c
github.com/go-stomp/stomp/v3.(*Conn).Ack(0x0?, 0x1021c5e4f?)
/Volumes/DATA/Runtimes/GoPATH/pkg/mod/github.com/go-stomp/stomp/v3@v3.0.5/conn.go:674 +0x28
main.main()
/Volumes/DATA/Projects/club-server/club-server/afdian_mq_insert/rev/main.go:26 +0xf8
msg in nil, I think i need reconnect.
24 for {
25 msg := <-sub.C
26 stompConn.Ack(msg)
27 println(string(msg.Body))
28 }
How are you connecting? Also remember that subscription.C may return nil messages so it's the consumer responsibility to make sure you're operating on a valid message and it can be acked before trying to do so
On Mon, 6 Feb 2023, 10:25 niuhuan, @.***> wrote:
connect use ssl and network is not good can got this panic
wait a moment afert subscribe
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x40 pc=0x1021bf13c]
goroutine 1 [running]:github.com/go-stomp/stomp/v3.(*Conn).createAckNackFrame(0x140001666c0?, 0x14000119f60?, 0x1?) @./conn.go:723 +0x7cgithub.com/go-stomp/stomp/v3.(Conn).Ack(0x0?, 0x1021c5e4f?) **@.***/conn.go:674 +0x28 main.main() /Volumes/DATA/Projects/club-server/club-server/afdian_mq_insert/rev/main.go:26 +0xf8
— Reply to this email directly, view it on GitHub https://github.com/go-stomp/stomp/issues/98#issuecomment-1419363126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFE4G6ZUAIUZ3HSYANWNN3WWEQXRANCNFSM43TCA5KA . You are receiving this because you commented.Message ID: @.***>
It'd be nice if it just returned an error to say the connection has been closed
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0x677a41]
goroutine 1 [running]: github.com/go-stomp/stomp/v3.(*Conn).Subscribe(0x0, 0xc000025320, 0x90, 0x0, 0xc000cd1bc0, 0x4, 0x4, 0x0, 0x0, 0x0) github.com/go-stomp/stomp/v3@v3.0.0/conn.go:595 +0x61