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

nsqd: panic: runtime error: invalid memory address or nil pointer dereference #910

Closed
duyue9522 opened this issue Jun 20, 2017 · 5 comments
Labels

Comments

@duyue9522
Copy link

duyue9522 commented Jun 20, 2017

hi,
when i use nsqd --statsd-address=... post data to statsd/Graphite , the problem happend,my environment is :

Centos 6.5 64bit
golang version 1.7.4
nsqd version 1.0
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x51e003]

goroutine 38 [running]:
panic(0x7c1aa0, 0xc420010120)
        /usr/lib/golang/src/runtime/panic.go:500 +0x1a1
github.com/nsqio/nsq/nsqd.(*NSQD).statsdLoop(0xc42018c000)
        /data/go/src/github.com/nsqio/nsq/nsqd/statsd.go:126 +0x1983
github.com/nsqio/nsq/nsqd.(*NSQD).Main.func6()
        /data/go/src/github.com/nsqio/nsq/nsqd/nsqd.go:264 +0x2a
github.com/nsqio/nsq/internal/util.(*WaitGroupWrapper).Wrap.func1(0xc420161ba0, 0xc42018c0d8)
        /data/go/src/github.com/nsqio/nsq/internal/util/wait_group_wrapper.go:14 +0x27
created by github.com/nsqio/nsq/internal/util.(*WaitGroupWrapper).Wrap
        /data/go/src/github.com/nsqio/nsq/internal/util/wait_group_wrapper.go:16 +0x62
@mreiferson
Copy link
Member

I think this is a real bug, the line is obviously dereferencing a null pointer. But I'm really confused why this hasn't shown up before?

@mreiferson mreiferson added the bug label Jun 20, 2017
@ploxiln
Copy link
Member

ploxiln commented Jun 20, 2017

Hmm it's hard to see how that line could panic:
https://github.com/nsqio/nsq/blob/v0.3.8/nsqd/statsd.go#L126

gcPauses := make(Uint64Slice, length)

(it's the same in 1.0.0-compat but moved in master)

@mreiferson
Copy link
Member

I imagine it's this line: https://github.com/nsqio/nsq/blob/master/nsqd/statsd.go#L126

Where on the first run, lastMemStats is nil.

@ploxiln
Copy link
Member

ploxiln commented Jun 20, 2017

so probably not "nsqd version 0.38" you reckon ...

@mreiferson
Copy link
Member

see #911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants