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

Server code crashes with a segfault #39

Open
sflxn opened this issue Jun 12, 2015 · 3 comments
Open

Server code crashes with a segfault #39

sflxn opened this issue Jun 12, 2015 · 3 comments

Comments

@sflxn
Copy link

sflxn commented Jun 12, 2015

Hey, I am trying to use this library, but it crashes under Linux. It works fine on OS X Yosemite, but when I tried to run it under Ubuntu 14.04 in vbox, I get a crash. I will try to look at the code and see if I can resolve it, but I just wanted to document the crash here.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4c90a3]

goroutine 12 [running]:
github.com/hashicorp/mdns.(_MDNSService).Records(0x0, 0xc20801eb60, 0x15, 0x1000c, 0x0, 0x0, 0x0)
/home/loc/projects/go/src/github.com/hashicorp/mdns/zone.go:139 +0x343
github.com/hashicorp/mdns.(_Server).handleQuestion(0xc20803b680, 0xc20801eb60, 0x15, 0x1000c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)

@sflxn
Copy link
Author

sflxn commented Jun 12, 2015

In Server.handleQuestion, the first call is to MDNSService.Records. When it segfaults, the MDNSService pointer object that you are calling Records on is nil. I've just noticed today that it doesn't always crash and the MDNSService is not always nil, but it happens often. Just to be clear, I am following the code snippet for setting up a server and client you have on github.

@optlink
Copy link

optlink commented Oct 27, 2023

This issue still occurs

@mholt
Copy link

mholt commented Feb 11, 2024

The readme code ignores errors. If you actually do the error checks you'll probably find a non-nil error.

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

3 participants