Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic on Ubuntu 20.04.3 LTS (kernel version 5.4.0-91-generic) #286

Closed
jzwlqx opened this issue May 27, 2024 · 0 comments
Closed

panic on Ubuntu 20.04.3 LTS (kernel version 5.4.0-91-generic) #286

jzwlqx opened this issue May 27, 2024 · 0 comments

Comments

@jzwlqx
Copy link
Collaborator

jzwlqx commented May 27, 2024

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

goroutine 71 [running]:
github.com/alibaba/kubeskoop/pkg/exporter/probe/procsock.getHostTCPSockstat()
        /root/kubeskoop/pkg/exporter/probe/procsock/procsock.go:181 +0x56c
github.com/alibaba/kubeskoop/pkg/exporter/probe/procsock.collect()
        /root/kubeskoop/pkg/exporter/probe/procsock/procsock.go:88 +0xea
github.com/alibaba/kubeskoop/pkg/exporter/probe/procsock.(*ProcSock).CollectOnce(...)
        /root/kubeskoop/pkg/exporter/probe/procsock/procsock.go:48
github.com/alibaba/kubeskoop/pkg/exporter/probe.(*legacyBatchMetrics).Collect(0xc0009d5e90, 0xc0000a0600)
        /root/kubeskoop/pkg/exporter/probe/legacy.go:113 +0x9e
github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
        /root/go/pkg/mod/github.com/prometheus/client_golang@v1.15.1/prometheus/registry.go:455 +0x105
created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather in goroutine 66
        /root/go/pkg/mod/github.com/prometheus/client_golang@v1.15.1/prometheus/registry.go:547 +0xbab

Below is example of /proc/net/sockstat6

TCP6: inuse 0
UDP6: inuse 1
UDPLITE6: inuse 0
RAW6: inuse 1
FRAG6: inuse 0 memory 0

Code:

res.InUse += stat6.Protocols[idx].InUse
res.Orphan += *stat6.Protocols[idx].Orphan  // Orphan is nil
res.Alloc += *stat6.Protocols[idx].Alloc // Alloc is nil
res.TW += *stat6.Protocols[idx].TW 
res.Mem += *stat6.Protocols[idx].Mem
@BSWANG BSWANG closed this as completed in 2407991 May 27, 2024
BSWANG added a commit that referenced this issue May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant