-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
net: dns lookup crashes app : __libc_res_nquery: Assertion `hp != hp2' failed. #7191
Labels
Milestone
Comments
Comment 4 by matthew.kanwisher: It appears to be a glibc issues ;( https://bugzilla.redhat.com/show_bug.cgi?id=730856 you think if we put a recover in the goroutine it would prevent the app from crashing or is there nothing go can do ? |
in general, we can't do much about signals received when executing cgo code. 1. we can't reliably unwind cgo code. 2. C is not memory safe, so by the time the signal arrives, the memory could have already been corrupted, for example, in this case, the fact that the glibc developers placed an assertion in their code probably suggests that if the assertion turns out to be false, it's internal is inconsistent, so even if we could recover from it, the next DNS lookup might trigger the problem again. In other words, we can't do much about this issue (even C/C++ application can't do much on this issue) If you can't deploy updates to the glibc bug, and can withstand the limits of the pure Go resolver, you can do this to recompile a pure Go version of net package without disabling cgo: go install -tags netgo -a std and then rebuild your program, so it won't use the buggy glibc resolvers (please be aware that the pure Go resolver has several limitations, and others probably could explain them better than me). |
Given this issue's age and the fact it was a glibc issue that should have been fixed in SUSE and other distributions, should it be closed? |
Closing works for me. Plus Go uses its own DNS resolver by default these days. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by matthew.kanwisher:
The text was updated successfully, but these errors were encountered: