streamingfast / firehose-aptos

Firehose Aptos
Apache License 2.0
6 stars 3 forks source link

Nil pointer dereference #15

Closed ppoliani closed 1 year ago

ppoliani commented 1 year ago

I run this with the latest changes (i.e. substream package version update). Unfortunately, when my custom sink connect the service crashes with the following stacktrace

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

goroutine 7369 [running]:
github.com/streamingfast/substreams/service.(*StreamFactory).New(0xc0007aff50, {0x2bb5ac0, 0xc0007573b0}, {0x2b9a920, 0xc00f6c39e0}, 0xc014b6a3c0?, 0x9184e72a000, {0x0, 0x0}, 0x0)
        /root/work/pkg/mod/github.com/streamingfast/substreams@v0.1.0/service/stream.go:48 +0x329
github.com/streamingfast/substreams/service.(*Service).blocks(0xc00078fad0, {0x2bb5ac0, 0xc0002fd4a0}, {0x3e8, 0x64, 0x2710, 0x2, {0x2bc1c38, 0xc00062ad80}, 0xc00026e930, ...}, ...)
        /root/work/pkg/mod/github.com/streamingfast/substreams@v0.1.0/service/service.go:312 +0x16b8
github.com/streamingfast/substreams/service.(*Service).Blocks(0xc00078fad0, 0xc000654cc0, {0x2bbb940, 0xc00026fc40})
        /root/work/pkg/mod/github.com/streamingfast/substreams@v0.1.0/service/service.go:192 +0xe45
github.com/streamingfast/substreams/pb/sf/substreams/v1._Stream_Blocks_Handler({0x2707180?, 0xc00078fad0}, {0x2bb9c10, 0xc011a2db30})
        /root/work/pkg/mod/github.com/streamingfast/substreams@v0.1.0/pb/sf/substreams/v1/substreams_grpc.pb.go:99 +0xd0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.StreamServerInterceptor.func1({0x2707180, 0xc00078fad0}, {0x2bb9820, 0xc0000982e0}, 0xc00f425560, 0x290d4e8)
        /root/work/pkg/mod/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc@v0.36.4/interceptor.go:432 +0x43a
github.com/grpc-ecosystem/go-grpc-middleware.ChainStreamServer.func1.1.1({0x2707180?, 0xc00078fad0?}, {0x2bb9820?, 0xc0000982e0?})
        /root/work/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:49 +0x3a
github.com/streamingfast/dgrpc/server/standard.SetupLoggingInterceptors.func2({0x2707180, 0xc00078fad0}, {0x2bbac18?, 0xc0000982c0?}, 0xc0000982c0?, 0xc000117e60)
        /root/work/pkg/mod/github.com/streamingfast/dgrpc@v0.0.0-20221031174241-978a7951c117/server/standard/logging.go:46 +0x138
github.com/grpc-ecosystem/go-grpc-middleware.ChainStreamServer.func1.1.1({0x2707180?, 0xc00078fad0?}, {0x2bbac18?, 0xc0000982c0?})
        /root/work/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:49 +0x3a
github.com/streamingfast/dgrpc/server.StreamAuthChecker.func1({0x2707180, 0xc00078fad0}, {0x2bb9820?, 0xc0000982a0?}, 0x27377c0?, 0xc000117ea0)
        /root/work/pkg/mod/github.com/streamingfast/dgrpc@v0.0.0-20221031174241-978a7951c117/server/authentication.go:93 +0xe2
github.com/grpc-ecosystem/go-grpc-middleware.ChainStreamServer.func1.1.1({0x2707180?, 0xc00078fad0?}, {0x2bb9820?, 0xc0000982a0?})
        /root/work/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:49 +0x3a
github.com/grpc-ecosystem/go-grpc-middleware/logging/zap.StreamServerInterceptor.func1({0x2707180, 0xc00078fad0}, {0x2bb9c10, 0xc011a2d8c0?}, 0xc00f425560, 0xc000117ee0)
        /root/work/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/logging/zap/server_interceptors.go:53 +0x218
github.com/grpc-ecosystem/go-grpc-middleware.ChainStreamServer.func1.1.1({0x2707180?, 0xc00078fad0?}, {0x2bb9c10?, 0xc011a2d8c0?})
        /root/work/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:49 +0x3a
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.StreamServerInterceptor.func1({0x2707180, 0xc00078fad0}, {0x2bb98f8, 0xc00f4255a8}, 0xc00f425560, 0xc000117f20)
        /root/work/pkg/mod/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc@v0.36.4/interceptor.go:432 +0x43a
github.com/grpc-ecosystem/go-grpc-middleware.ChainStreamServer.func1.1.1({0x2707180?, 0xc00078fad0?}, {0x2bb98f8?, 0xc00f4255a8?})
        /root/work/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:49 +0x3a
github.com/grpc-ecosystem/go-grpc-prometheus.(*ServerMetrics).StreamServerInterceptor.func1({0x2707180, 0xc00078fad0}, {0x2bb9868?, 0xc00f728780}, 0x27a1c40?, 0xc000117fa0)
        /root/work/pkg/mod/github.com/grpc-ecosystem/go-grpc-prometheus@v1.2.0/server_metrics.go:121 +0x109
github.com/grpc-ecosystem/go-grpc-middleware.ChainStreamServer.func1.1.1({0x2707180?, 0xc00078fad0?}, {0x2bb9868?, 0xc00f728780?})
        /root/work/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:49 +0x3a
github.com/grpc-ecosystem/go-grpc-middleware/tags.StreamServerInterceptor.func1({0x2707180, 0xc00078fad0}, {0x2bb9d30, 0xc00056b7a0?}, 0xc00f425560, 0xc000117fe0)
        /root/work/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/tags/interceptors.go:39 +0x218
github.com/grpc-ecosystem/go-grpc-middleware.ChainStreamServer.func1.1.1({0x2707180?, 0xc00078fad0?}, {0x2bb9d30?, 0xc00056b7a0?})
        /root/work/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:49 +0x3a
github.com/grpc-ecosystem/go-grpc-middleware.ChainStreamServer.func1({0x2707180, 0xc00078fad0}, {0x2bb9d30, 0xc00056b7a0}, 0x23f30a0?, 0xc011b5aa50?)
        /root/work/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:58 +0xbe
google.golang.org/grpc.(*Server).processStreamingRPC(0xc00076ad20, {0x2bbd7a0, 0xc00f654d80}, 0xc0113726c0, 0xc000760030, 0x3d8d640, 0x0)
        /root/work/pkg/mod/google.golang.org/grpc@v1.50.1/server.go:1636 +0x11c6
google.golang.org/grpc.(*Server).handleStream(0xc00076ad20, {0x2bbd7a0, 0xc00f654d80}, 0xc0113726c0, 0x0)
        /root/work/pkg/mod/google.golang.org/grpc@v1.50.1/server.go:1717 +0x9ea
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        /root/work/pkg/mod/google.golang.org/grpc@v1.50.1/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        /root/work/pkg/mod/google.golang.org/grpc@v1.50.1/server.go:963 +0x28a
maoueh commented 1 year ago

I've just bumped to Substreams 0.2.0 (and a bit further) which fixes your issue, closing but please report that it's indeed fixed.

maoueh commented 1 year ago

Also, check the CHANGELOG.md for some flag renaming that happened with this release.

ppoliani commented 1 year ago

I've just bumped to Substreams 0.2.0 (and a bit further) which fixes your issue, closing but please report that it's indeed fixed.

Fantastic! I've just tested this and it works perfectly fine 👍