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

After a frame error, call to Subscribe results in a SIGSEGV #98

Open
jimmy-moore opened this issue Apr 26, 2021 · 4 comments
Open

After a frame error, call to Subscribe results in a SIGSEGV #98

jimmy-moore opened this issue Apr 26, 2021 · 4 comments

Comments

@jimmy-moore
Copy link

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

@worg
Copy link
Collaborator

worg commented Apr 26, 2021

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?

@jimmy-moore
Copy link
Author

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...

@niuhuan
Copy link

niuhuan commented Feb 6, 2023

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	}

@worg
Copy link
Collaborator

worg commented Feb 6, 2023 via email

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

3 participants