streamnative / pulsar-client-go

Apache Pulsar Go Client Library
https://pulsar.apache.org/
Apache License 2.0
1 stars 2 forks source link

ISSUE-718: Panic on `NewReader` - nil pointer dereference in TopicNameWithoutPartitionPart #258

Open sijie opened 2 years ago

sijie commented 2 years ago

Original Issue: apache/pulsar-client-go#718


https://github.com/apache/pulsar-client-go/blob/edf81af225d1573848584a7e48f090a558a9c620/pulsar/internal/topic_name.go#L110

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

goroutine 1691 [running]:
github.com/apache/pulsar-client-go/pulsar/internal.TopicNameWithoutPartitionPart(0xc0006de100)
    /src/vendor/github.com/apache/pulsar-client-go/pulsar/internal/topic_name.go:110 +0x18
github.com/apache/pulsar-client-go/pulsar/internal.(*Metrics).GetLeveledMetrics(0xc0005b0dc0, {0xc0006de100, 0x7b})
    /src/vendor/github.com/apache/pulsar-client-go/pulsar/internal/metrics.go:486 +0x6f
github.com/apache/pulsar-client-go/pulsar.newReader(0xc000132840, {{0xc0006de100, 0x7b}, {0x0, 0x0}, 0x0, {0x1d38d58, 0xc000143f68}, 0x0, 0x0, ...})
    /src/vendor/github.com/apache/pulsar-client-go/pulsar/reader_impl.go:99 +0x53d
github.com/apache/pulsar-client-go/pulsar.(*client).CreateReader(0xc000132840, {{0xc0006de100, 0x7b}, {0x0, 0x0}, 0x0, {0x1d38d58, 0xc000143f68}, 0x0, 0x0, ...})
    /src/vendor/github.com/apache/pulsar-client-go/pulsar/client_impl.go:171 +0x58
github.com/cogitocorp/compute-platform-library/pkg/platform/pulsarhelpers.PulsarHelper.NewReader({{{0xc0000401b0, 0x24}, {0x0, 0x0}}, {0x1d38418, 0xc000132840}, {0xc000590650, 0xc}}, {0xc0006de100, 0x7b})