pactus-project / pactus

Pactus blockchain
https://pactus.org
MIT License
124 stars 136 forks source link

Panic on gRPC server #1231

Open themantre opened 1 month ago

themantre commented 1 month ago

We have a panic on gRPC server (probably on Broadcast Transaction API). Here is the log from one of the servers:

github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).ExecuteC(0xc000187508)
        github.com/spf13/cobra@v1.8.0/command.go:987 +0xab1
github.com/spf13/cobra.(*Command).execute(0xc000468308, {0xc00046a0c0, 0x4, 0x4})
        github.com/pactus-project/pactus/cmd/daemon/start.go:93 +0x214
main.buildStartCmd.func1(0xc000464200?, {0x1526752?, 0x4?, 0x1526756?})
goroutine 1 [select (no cases), 886 minutes]:
        google.golang.org/grpc@v1.63.0/server.go:1030 +0x125
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 280108
        google.golang.org/grpc@v1.63.0/server.go:1019 +0x8b
google.golang.org/grpc.(*Server).serveStreams.func2.1()
        google.golang.org/grpc@v1.63.0/server.go:1780 +0xe8b
google.golang.org/grpc.(*Server).handleStream(0xc00239ce00, {0x1c77540, 0xc009870000}, 0xc008d14c60)
        google.golang.org/grpc@v1.63.0/server.go:1416 +0xf3d
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00239ce00, {0x1c6b038, 0xc00a077b00}, {0x1c77540, 0xc009870000}, 0xc008d14c60, 0xc00326e090, 0x27081e0,>
        google.golang.org/grpc@v1.63.0/server.go:1130 +0x90
google.golang.org/grpc.(*Server).sendResponse(0xc00239ce00, {0x1c6b038, 0xc00a077b90}, {0x1c77540, 0xc009870000}, 0xc008d14c60, {0x14834c0, 0xc007b88e00}, >
        google.golang.org/grpc@v1.63.0/rpc_util.go:647 +0x3e
google.golang.org/grpc.encode({0x7fe2147931c0?, 0x278a580?}, {0x14834c0?, 0xc007b88e00?})
        google.golang.org/grpc@v1.63.0/encoding/proto/proto.go:47 +0x52
google.golang.org/grpc/encoding/proto.codec.Marshal({}, {0x14834c0?, 0xc007b88e00?})
        google.golang.org/protobuf@v1.33.0/proto/encode.go:80 +0x50
google.golang.org/protobuf/proto.Marshal({0x1c5c380, 0xc007b88e00})
        google.golang.org/protobuf@v1.33.0/proto/encode.go:166 +0x24e
google.golang.org/protobuf/proto.MarshalOptions.marshal({{}, 0x1?, 0x77?, 0x4e?}, {0x0, 0x0, 0x0}, {0x1c7d318, 0xc007b88e00})
        google.golang.org/protobuf@v1.33.0/internal/impl/encode.go:107 +0x85
google.golang.org/protobuf/internal/impl.(*MessageInfo).marshal(0x0?, {{}, {0x1c7d318, 0xc007b88e00}, {0xc00c058000, 0x0, 0x93800}, 0x2})
        google.golang.org/protobuf@v1.33.0/internal/impl/encode.go:139 +0x13f
google.golang.org/protobuf/internal/impl.(*MessageInfo).marshalAppendPointer(0xc0003f8d50, {0xc00c058000?, 0x94000?, 0x7fe25e71b5b8?}, {0x94000?}, {0x8?})
        google.golang.org/protobuf@v1.33.0/internal/impl/codec_field.go:485 +0xf1
google.golang.org/protobuf/internal/impl.appendMessageSliceInfo({0xc00c058000?, 0x7fe21479cca0?, 0x0?}, {0x413ce5?}, 0xc002bd5628, {0x40?})
        google.golang.org/protobuf@v1.33.0/internal/impl/encode.go:139 +0x13f
google.golang.org/protobuf/internal/impl.(*MessageInfo).marshalAppendPointer(0xc0003f9128, {0xc00c058000?, 0x814a68?, 0x2b9?}, {0x4784f2?}, {0xf0?})
        google.golang.org/protobuf@v1.33.0/internal/impl/codec_map.go:56 +0x7e
google.golang.org/protobuf/internal/impl.encoderFuncsForMap.func2({0xc00c058000, 0x686da, 0x93800}, {0x15?}, 0xc00026d378, {0x40?})
        google.golang.org/protobuf@v1.33.0/internal/impl/codec_map.go:274 +0x1d3
google.golang.org/protobuf/internal/impl.appendMap({0xc00c058000, 0x686da, 0x93800}, {0x13048e0?, 0xc0042a2c20?, 0x807bbd?}, 0xc007e22820, 0xc00026d378, {0>
        reflect/value.go:2005 +0x74
reflect.(*MapIter).Next(0xc007e22820?)
        runtime/map.go:1392 +0x13
reflect.mapiternext(0x0?)
goroutine 1917171 [running]:
fatal error: concurrent map iteration and map write