shoenig / go-mqtt

A development fork of the Eclipse Paho Go MQTT client
http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.golang.git/
Eclipse Public License 1.0
13 stars 6 forks source link

Memstore needs some locking #20

Closed shoenig closed 10 years ago

shoenig commented 10 years ago

Playing with a real MessageSight, running into some errors at speed.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x1 pc=0x4085ff]

goroutine 5 [running]:
runtime.panic(0x642be0, 0x92d8e8)
    /usr/local/go/src/pkg/runtime/panic.c:266 +0xb6
github.com/shoenig/go-mqtt.(*MemoryStore).Put(0xc2100544c0, 0xc2100882b0, 0x3, 0xc2100864e0)
    /home/sahoenig/Documents/GO/src/github.com/shoenig/go-mqtt/memstore.go:35 +0x64
github.com/shoenig/go-mqtt.persist_obound(0x7f4350ed9548, 0xc2100544c0, 0xc2100864e0)
    /home/sahoenig/Documents/GO/src/github.com/shoenig/go-mqtt/store.go:66 +0x124
github.com/shoenig/go-mqtt.outgoing(0xc210041e00)
    /home/sahoenig/Documents/GO/src/github.com/shoenig/go-mqtt/net.go:85 +0x2f5
created by github.com/shoenig/go-mqtt.(*MqttClient).Start
    /home/sahoenig/Documents/GO/src/github.com/shoenig/go-mqtt/client.go:143 +0x453