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

github.com/godbus/dbus/homedir_dynamic.go is linked into static binary #1422

Closed
tgraf opened this issue Apr 26, 2017 · 2 comments
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@tgraf
Copy link
Contributor

tgraf commented Apr 26, 2017

For some reason, the localkube static binary compiles in the version of homedir.go intented for dynamic linking which lacks proper protection when calling current(). The panic is attached below.

The original issue is described here:
golang/go#13470

And the fix that went into godbus is here:
godbus/dbus@da6051a

which split homedir.go into a dynamic and static version selected using +build static_build

For some reason, the localkube binary is built and linked against the dynamic version as seen in the panic stacktrace.
https://github.com/godbus/dbus/blob/master/homedir_dynamic.go

I'm using:
go version go1.7.4 darwin/amd64

Any indication why the +build static_build in vendor/github.com/godbus/dbus/homedir_dynamic.go is not effective? Are the vendor packages compiled for minikube first which is not statically linked?

Apr 26 23:21:34 minikube localkube[3531]: fatal error: unexpected signal during runtime execution
Apr 26 23:21:34 minikube localkube[3531]: [signal SIGSEGV: segmentation violation code=0x1 addr=0xe5 pc=0x7fb838b33100]
Apr 26 23:21:34 minikube localkube[3531]: runtime stack:
Apr 26 23:21:34 minikube localkube[3531]: runtime.throw(0x3ee050e, 0x2a)
Apr 26 23:21:34 minikube localkube[3531]:         /usr/local/go/src/runtime/panic.go:566 +0x95
Apr 26 23:21:34 minikube localkube[3531]: runtime.sigpanic()
Apr 26 23:21:34 minikube localkube[3531]:         /usr/local/go/src/runtime/sigpanic_unix.go:12 +0x2cc
Apr 26 23:21:34 minikube localkube[3531]: goroutine 6504 [syscall, locked to thread]:
Apr 26 23:21:34 minikube localkube[3531]: runtime.cgocall(0x31e3d30, 0xc423e672e8, 0x0)
Apr 26 23:21:34 minikube localkube[3531]:         /usr/local/go/src/runtime/cgocall.go:131 +0x110 fp=0xc423e67298 sp=0xc423e67258
Apr 26 23:21:34 minikube localkube[3531]: os/user._Cfunc_mygetpwuid_r(0x0, 0xc422f08ba0, 0x7fb830000a10, 0x400, 0xc422ae18f8, 0x0)
Apr 26 23:21:34 minikube localkube[3531]:         ??:0 +0x4d fp=0xc423e672e8 sp=0xc423e67298
Apr 26 23:21:34 minikube localkube[3531]: os/user.lookupUnixUid.func1(0x42a153)
Apr 26 23:21:34 minikube localkube[3531]:         /usr/local/go/src/os/user/lookup_unix.go:103 +0x1f7 fp=0xc423e67378 sp=0xc423e672e8
Apr 26 23:21:34 minikube localkube[3531]: os/user.retryWithBuffer(0xc421c2d410, 0xc423e67470, 0xc421c2d410, 0x40f6f3)
Apr 26 23:21:34 minikube localkube[3531]:         /usr/local/go/src/os/user/lookup_unix.go:253 +0x2b fp=0xc423e673e0 sp=0xc423e67378
Apr 26 23:21:34 minikube localkube[3531]: os/user.lookupUnixUid(0x0, 0x0, 0x0, 0x0)
Apr 26 23:21:34 minikube localkube[3531]:         /usr/local/go/src/os/user/lookup_unix.go:105 +0x141 fp=0xc423e674a8 sp=0xc423e673e0
Apr 26 23:21:34 minikube localkube[3531]: os/user.current(0xc423e67500, 0xc423e67518, 0x472eb5)
Apr 26 23:21:34 minikube localkube[3531]:         /usr/local/go/src/os/user/lookup_unix.go:49 +0x2f fp=0xc423e674d8 sp=0xc423e674a8
Apr 26 23:21:34 minikube localkube[3531]: os/user.Current(0x0, 0x0, 0xc423e67500)
Apr 26 23:21:34 minikube localkube[3531]:         /usr/local/go/src/os/user/lookup.go:9 +0x22 fp=0xc423e67500 sp=0xc423e674d8
Apr 26 23:21:34 minikube localkube[3531]: k8s.io/minikube/vendor/github.com/godbus/dbus.lookupHomeDir(0x3e41b19, 0x4)
Apr 26 23:21:34 minikube localkube[3531]:         /go/src/k8s.io/minikube/vendor/github.com/godbus/dbus/homedir_dynamic.go:10 +0x22 fp=0xc423e67528 sp=0xc423e67500
Apr 26 23:21:34 minikube localkube[3531]: k8s.io/minikube/vendor/github.com/godbus/dbus.getHomeDir(0x0, 0x0)
Apr 26 23:21:34 minikube localkube[3531]:         /go/src/k8s.io/minikube/vendor/github.com/godbus/dbus/homedir.go:26 +0x10d fp=0xc423e67558 sp=0xc423e67528
Apr 26 23:21:34 minikube localkube[3531]: k8s.io/minikube/vendor/github.com/godbus/dbus.(*Conn).Auth(0xc424e22d80, 0x0, 0x0, 0x0, 0x40fc7e, 0xc421c2d3c0)
Apr 26 23:21:34 minikube localkube[3531]:         /go/src/k8s.io/minikube/vendor/github.com/godbus/dbus/auth.go:57 +0xefb fp=0xc423e67890 sp=0xc423e67558
Apr 26 23:21:34 minikube localkube[3531]: k8s.io/minikube/vendor/github.com/godbus/dbus.SystemBus(0xc424e22d80, 0x0, 0x0)
@aaron-prindle aaron-prindle added the kind/bug Categorizes issue or PR as related to a bug. label May 1, 2017
r2d4 added a commit to r2d4/minikube that referenced this issue May 1, 2017
Fixes kubernetes#1422

godbus requires the static_build tag when building.  Normal static
compliation doesn't add this go build tag automatically.
@r2d4
Copy link
Contributor

r2d4 commented May 1, 2017

Building with the static suffix doesn't actually enable this build tag. It has to be enabled manually, I added a PR that enables it in localkube. Let me know if that works for you.

@r2d4 r2d4 closed this as completed in #1434 May 2, 2017
@tgraf
Copy link
Contributor Author

tgraf commented May 2, 2017

Building with the static suffix doesn't actually enable this build tag. It has to be enabled manually, I added a PR that enables it in localkube. Let me know if that works for you.

Thanks for fixing this!

dalehamel pushed a commit to dalehamel/minikube that referenced this issue May 3, 2017
Fixes kubernetes#1422

godbus requires the static_build tag when building.  Normal static
compliation doesn't add this go build tag automatically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants