blinklabs-io / gouroboros

Go implementation of the Cardano Ouroboros family of protocols
Apache License 2.0
67 stars 11 forks source link

Sporadic handshake test failure #439

Open agaffney opened 9 months ago

agaffney commented 9 months ago

Seen in https://github.com/blinklabs-io/gouroboros/actions/runs/7027883148/job/19122981742?pr=437

=== RUN   TestServerHandshakeRefuseVersionMismatch
panic: parsed message does not match expected value: got &handshake.MsgRefuse{MessageBase:protocol.MessageBase{_:struct {}{}, rawCbor:[]uint8{0x82, 0x2, 0x82, 0x0, 0x88, 0x19, 0x80, 0xd, 0x19, 0x80, 0x9, 0x19, 0x80, 0xc, 0x19, 0x80, 0xa, 0x19, 0x80, 0x10, 0x19, 0x80, 0xe, 0x19, 0x80, 0xf, 0x19, 0x80, 0xb}, MessageType:0x2}, Reason:[]interface {}{0x0, []interface {}{0x800d, 0x8009, 0x800c, 0x800a, 0x8010, 0x800e, 0x800f, 0x800b}}}, expected &handshake.MsgRefuse{MessageBase:protocol.MessageBase{_:struct {}{}, rawCbor:[]uint8{0x82, 0x2, 0x82, 0x0, 0x88, 0x19, 0x80, 0xd, 0x19, 0x80, 0x9, 0x19, 0x80, 0xc, 0x19, 0x80, 0xa, 0x19, 0x80, 0x10, 0x19, 0x80, 0xe, 0x19, 0x80, 0xf, 0x19, 0x80, 0xb}, MessageType:0x2}, Reason:[]interface {}{0, []uint16{0x8009, 0x800c, 0x800a, 0x8010, 0x800e, 0x800f, 0x800b, 0x800d}}}

goroutine 9 [running]:
github.com/blinklabs-io/gouroboros/internal/test/ouroboros_mock.(*Connection).asyncLoop(0xc0000160a0)
    /home/runner/work/gouroboros/gouroboros/internal/test/ouroboros_mock/connection.go:134 +0x198
created by github.com/blinklabs-io/gouroboros/internal/test/ouroboros_mock.NewConnection
    /home/runner/work/gouroboros/gouroboros/internal/test/ouroboros_mock/connection.go:78 +0x1cb
FAIL    github.com/blinklabs-io/gouroboros/protocol/handshake   0.011s
agaffney commented 7 months ago

A different one

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x6361d6]

goroutine 5 [running]:
github.com/blinklabs-io/gouroboros.(*Connection).ErrorChan(...)
    /home/agaffney/dev/blinklabs-io/gouroboros/connection.go:124
github.com/blinklabs-io/gouroboros/protocol/handshake_test.TestServerHandshakeRefuseVersionMismatch.func1()
    /home/agaffney/dev/blinklabs-io/gouroboros/protocol/handshake/server_test.go:128 +0x16
created by github.com/blinklabs-io/gouroboros/protocol/handshake_test.TestServerHandshakeRefuseVersionMismatch in goroutine 123
    /home/agaffney/dev/blinklabs-io/gouroboros/protocol/handshake/server_test.go:127 +0x66a
FAIL    github.com/blinklabs-io/gouroboros/protocol/handshake   0.008s