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

segfault when running #23

Open
grobian opened this issue Aug 2, 2017 · 3 comments
Open

segfault when running #23

grobian opened this issue Aug 2, 2017 · 3 comments

Comments

@grobian
Copy link

grobian commented Aug 2, 2017

I think I might be doing something wrong here, but I frequently get a segfault on both linux and darwin like this:

(ptah:working-repos/carbon-c-relay) % ~/go/bin/haggar -carbon=amun:2103 -prefix=prefix1
2017/08/02 10:09:28 master: pid 10469
2017/08/02 10:09:28 agent 0: launched
2017/08/02 10:09:38 agent 0: flushed 10000 metrics
2017/08/02 10:09:39 agent 1: launched
2017/08/02 10:09:39 agent 2: launched
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x4d9d16]

goroutine 18 [running]:
main.(*Agent).flush.func1(0xc420043f50)
        /home/grobian/go/src/github.com/gorsuch/haggar/main.go:60 +0x26
main.(*Agent).flush(0xc420043f50, 0x59b4a0, 0xc4200a26e0)
        /home/grobian/go/src/github.com/gorsuch/haggar/main.go:70 +0x2db
main.(*Agent).Start(0xc420043f50)
        /home/grobian/go/src/github.com/gorsuch/haggar/main.go:41 +0x71
main.launchAgent(0x0, 0x2710, 0x2540be400, 0x7fff8a1842b3, 0x9, 0x7fff8a1842c5, 0x7)
        /home/grobian/go/src/github.com/gorsuch/haggar/main.go:86 +0xeb
created by main.main
        /home/grobian/go/src/github.com/gorsuch/haggar/main.go:128 +0x3a6

Thanks for this nice tool! Any suggestions or ideas on what I'm doing wrong here?
(Or could it be the relay closing sockets on you without you expecting that?)

gorsuch added a commit that referenced this issue Aug 4, 2017
ref #23

we were closing sockets that might not actually be open.
@gorsuch gorsuch mentioned this issue Aug 4, 2017
@gorsuch
Copy link
Owner

gorsuch commented Aug 4, 2017

Hi @grobian -- thanks for submitting this issue. I was out of town and didn't get a chance to look at it until now.

I submitted a potential fix here -- #24.

If you have the cycles, I'd love for you to give things a shot now and see if the problem persists.

@grobian
Copy link
Author

grobian commented Aug 6, 2017

FYI I worked around the issue by using -cache_connections. Running off the fix-24 branch now, up to 3.4M metrics, which it never made before without caching connections, so it seems fixed!

@gorsuch
Copy link
Owner

gorsuch commented Aug 6, 2017

fantastic -- thank you for the review and for reporting this bug! I'll merge it in.

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

2 participants