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: binaries packed with UPX run into segfault with 1.8 #19625
Comments
Have you filed a bug against upx? |
@bradfitz: I haven't filed a bug against UPX because this was working properly with Go 1.7.5. I don't have a strong opinion related to this. Some use UPX to get smaller binaries. It seemed to be a good idea to bring this up since Go 1.8.1 is the next release. I didn't know whether this was a known issue or not. Please feel free to close this immediately if it's not considered an issue or a bug. |
We don't maintain UPX. If things worked or didn't work at some point, that's either luck or it's because UPX did or didn't support something at one point. I'll close this until there's any evidence that Go is violating some ELF spec or something. |
@unclejack FYI - just had the same problem, but i was using the same GO version on my old app and new one which was very similar to yours - simple "hello world". It seems that it throws "core dumped" when GO binary is too small ;-) Go binary size: 3,7M - after UPX: 897K - core dumped No idea where's the actual border line for UPX to make things work, i had not that much time to play with it. Tested with: EDIT: I took this code from softlayer repo, just to trigger their package for compiler and test it against UPX. 11M before UPX, 2,4M after UPX - works but kinda pointless in this kind of small app - should work with real one thought. |
What version of Go are you using (
go version
)?go version go1.8 linux/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build006597881=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
foo.go:
https://play.golang.org/p/4tyqhiibb5
What did you expect to see?
I expected to see "asd" printed.
What did you see instead?
Segmentation fault (core dumped)
The text was updated successfully, but these errors were encountered: