-
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
cmd/link: don't swallow external linker warnings #17935
Comments
Can you try Go tip? (git master) /cc @mdempsky |
/cc @quentinmit |
I'm not able to reproduce this on Ubuntu 14.04 with either tip or Go 1.7.3. Can you share your /etc/resolv.conf and /etc/hosts files? |
/etc/hosts:
/etc/resolve.conf
|
@mdempsky If it helps, this is running on a digital ocean droplet. I also have a vmware fusion instance of ubuntu 16.04 where I don't run into this error, and I haven't figured out what the difference is yet. Fusion vm:
|
@bradfitz Not sure I did this right, but still get the issue on master:
I built go tip using the downloaded go 1.7.3 install as the |
Maybe gdb would say something useful? /cc @ianlancetaylor too. |
@bradfitz Apologies, I haven't used gdb much. Not sure where to go from here?
|
On the machine that segfaults:
On the machine that does not:
|
Ah, so I can reproduce this if I install libnss-myhostname. And you can On 16 November 2016 at 14:57, Ying Li notifications@github.com wrote:
|
@mwhudson Yes! You are absolutely correct - removing |
libc: 0 |
Thanks so much for all your help, everyone! |
It's a well-known glibc problem that statically linked multithreaded
program doesn't play well with dlopen, but I wonder why this also affects
dynamically linked cgo program.
|
On 16 November 2016 at 15:25, Minux Ma notifications@github.com wrote:
Did you miss the -extldflags -static? |
Ahh, sorry. I missed that.
I think we should forbid static linking with glibc -- it's known to be
buggy and non-portable (matching nss libraries are still required to run
the program, which is not what people want from static linking.)
|
Actually, I think the external linker ought to produce warning for this
case. Are we silencing those warnings?
|
Yes, in effect we are silencing warnings from the external linker. If it succeeds, we only display the output if -v were used. |
I think we shouldn't silence warning from the external linker. What do you
think?
|
I think it's worth a try. |
CL https://golang.org/cl/33301 mentions this issue. |
I think there may be something wrong with cgo networking DNS name resolution. I get a segfault when attempting to reach a server with an invalid TLD type name (for instance, the an alias I might put in
/etc/hosts
).What version of Go are you using (
go version
)?go version go1.7.3 linux/amd64
What operating system and processor architecture are you using (
go env
)?Running on Ubuntu 16.04.
What did you do?
Built a static binary using the following file:
What did you expect to see?
What did you see instead?
This does not happen if attempt to reach a valid domain name, if I do
./temp http://not-a-thing.com"
It also happens if I reach a
.local
domain:./temp http://not-really-a-domain-name.local
This does not happen if I compile a non-static binary:
I think this is a duplicate of #7857, which got closed for inactivity.
I've also seen this here: prometheus/alertmanager#304
Workaround
Passing
-tags netgo
fixes it.The text was updated successfully, but these errors were encountered: