-
Notifications
You must be signed in to change notification settings - Fork 539
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
packets.(*PingreqPacket).Write(0xc8200f3b60, 0x0, 0x0, 0x0, 0x0), invalid memory address or nil pointer dereference #65
Comments
It looks from the trace there as though you might be using an old version of the library, the repository at org.eclipse.paho.mqtt.golang.git is not up to date compared to the github.com hosted one. Please ensure you are have downloaded and are importing |
It doesn't work. Thanks anyway. |
@alsm , I've seen this happen with a v1.1.1 as well (though I'm running a custom mod built on top of v1.1.1). The repro is not as frequent; but may be reproducible on long-running/stressed environments. I put a deferred recovery around the I had also enabled logging on all levels and additional log entries on
|
Closing due to age/inactivity. Please feel free to reopen if this issue is occurring with the current release. |
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x20 pc=0x561e72]
goroutine 38 [running]:
bytes.(*Buffer).WriteTo(0xc82048adf8, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/bytes/buffer.go:206 +0xc2
org.eclipse.paho.mqtt.golang.git/packets.(*PingreqPacket).Write(0xc8200f3b60, 0x0, 0x0, 0x0, 0x0)
org.eclipse.paho.mqtt.golang.git/packets/pingreq.go:23 +0x83
org%2eeclipse%2epaho%2emqtt%2egolang%2egit.keepalive(0xc8201dc300)
org.eclipse.paho.mqtt.golang.git/ping.go:60 +0x77a
created by org%2eeclipse%2epaho%2emqtt%2egolang%2egit.(*Client).Connect.func1
org.eclipse.paho.mqtt.golang.git/client.go:212 +0x13a1
using it in my project, after running a few days(maybe 10, 0000 times), packets.(*PingreqPacket).Write(0xc8200f3b60, 0x0, 0x0, 0x0, 0x0) will write fail case the err above "invalid memory address or nil pointer dereference"
i use the packets like this :
func main() {
client := MQTT.NewClient(opts)
go publishMessage(
client.Publish() //will be exec every 3 seconds
)
client.Subscribe()
}
The text was updated successfully, but these errors were encountered: