otrv4 / pidgin-otrng

Fork of https://bugs.otr.im/plugins/pidgin-otr. This is a mirror of https://bugs.otr.im/otrv4/pidgin-otrng
GNU General Public License v2.0
16 stars 5 forks source link

Segmentation fault on server #75

Closed claucece closed 5 years ago

claucece commented 5 years ago

This has shown up. It is impossible right now to initialize a non-interactive conversation

prekeys-raw_1   | panic: runtime error: invalid memory address or nil pointer dereference
prekeys-raw_1   | [signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x500eaf]
prekeys-raw_1   | 
prekeys-raw_1   | goroutine 57 [running]:
prekeys-raw_1   | github.com/otrv4/otrng-prekey-server/vendor/github.com/coyim/gotrax.(*ClientProfile).SerializeForSignature(0x0, 0x40, 0x14, 0xc0002dbf01)
prekeys-raw_1   |   /go/src/github.com/otrv4/otrng-prekey-server/vendor/github.com/coyim/gotrax/otr_serialize.go:12 +0x4f
prekeys-raw_1   | github.com/otrv4/otrng-prekey-server/vendor/github.com/coyim/gotrax.(*ClientProfile).Serialize(0x0, 0x40, 0x64, 0x80)
prekeys-raw_1   |   /go/src/github.com/otrv4/otrng-prekey-server/vendor/github.com/coyim/gotrax/otr_serialize.go:51 +0x2f
prekeys-raw_1   | github.com/otrv4/otrng-prekey-server.(*fileStorage).storeClientProfile(0xc000042710, 0xc0000ee010, 0xf, 0x0, 0xc000210d60, 0xc000486310)
prekeys-raw_1   |   /go/src/github.com/otrv4/otrng-prekey-server/file_storage.go:79 +0x32
prekeys-raw_1   | github.com/otrv4/otrng-prekey-server.(*publicationMessage).respond(0xc0000da280, 0xc0000ee010, 0xf, 0xc000010210, 0x0, 0x0, 0x0, 0x0)
prekeys-raw_1   |   /go/src/github.com/otrv4/otrng-prekey-server/messages.go:304 +0x76
prekeys-raw_1   | github.com/otrv4/otrng-prekey-server.(*otrngMessageHandler).handleInnerMessage(0xc00000e080, 0xc0000ee010, 0xf, 0xc00025c15b, 0xb39f, 0xb3a1, 0x50, 0xc000160000, 0x109, 0x140)
prekeys-raw_1   |   /go/src/github.com/otrv4/otrng-prekey-server/message_handler.go:41 +0x18c
prekeys-raw_1   | github.com/otrv4/otrng-prekey-server.(*dake3Message).respond(0xc000138090, 0xc0000ee010, 0xf, 0xc000010210, 0x0, 0x0, 0x0, 0x0)
prekeys-raw_1   |   /go/src/github.com/otrv4/otrng-prekey-server/dake.go:116 +0x6c
prekeys-raw_1   | github.com/otrv4/otrng-prekey-server.(*otrngMessageHandler).handleInnerMessage(0xc00000e080, 0xc0000ee010, 0xf, 0xc00025c000, 0xb4fa, 0xb4fc, 0xb4fc, 0xb4fc, 0xc0000cc010, 0xc00003dce8)
prekeys-raw_1   |   /go/src/github.com/otrv4/otrng-prekey-server/message_handler.go:41 +0x18c
prekeys-raw_1   | github.com/otrv4/otrng-prekey-server.(*otrngMessageHandler).handleMessage(0xc00000e080, 0xc0000ee010, 0xf, 0xc00025c000, 0xb4fa, 0xb4fc, 0xc00025c000, 0xb4fa, 0xb4fc, 0x0, ...)
prekeys-raw_1   |   /go/src/github.com/otrv4/otrng-prekey-server/message_handler.go:15 +0x67
prekeys-raw_1   | github.com/otrv4/otrng-prekey-server.(*GenericServer).handleMessage(0xc000010210, 0xc0000ee010, 0xf, 0xc00025c000, 0xb4fa, 0xb4fc, 0xf151, 0xfded, 0xc00003de18, 0x40d5a8, ...)
prekeys-raw_1   |   /go/src/github.com/otrv4/otrng-prekey-server/server.go:42 +0x7c
prekeys-raw_1   | github.com/otrv4/otrng-prekey-server.(*GenericServer).Handle(0xc000010210, 0xc0000ee010, 0xf, 0xc00013c000, 0xf151, 0x1, 0x0, 0x0, 0xf164, 0xc00003de88)
prekeys-raw_1   |   /go/src/github.com/otrv4/otrng-prekey-server/server.go:79 +0x178
prekeys-raw_1   | main.protocolHandleData(0xc00024c000, 0xf164, 0xfe00, 0x619aa0, 0xc000010210, 0x0, 0x0, 0x0, 0x0, 0x0)
prekeys-raw_1   |   /go/src/github.com/otrv4/otrng-prekey-server/server/raw/protocol.go:35 +0x123
prekeys-raw_1   | main.(*rawServer).handleRequest(0xc0000543c0, 0x7f257887a000, 0xc0000cc008)
prekeys-raw_1   |   /go/src/github.com/otrv4/otrng-prekey-server/server/raw/server.go:99 +0x1fe
prekeys-raw_1   | created by main.(*rawServer).listenWith
prekeys-raw_1   |   /go/src/github.com/otrv4/otrng-prekey-server/server/raw/server.go:78 +0x323
prekeys-xmpp_1  | encountered error when communicating with the raw server: read tcp 172.19.0.4:47214->172.19.0.3:30123: read: connection reset by peer
claucece commented 5 years ago

cc./ @olabini

olabini commented 5 years ago

This was caused by the prekey server always assuming that you would publish client profiles and prekey profiles. This has been fixed now.