Navigation Menu

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

[LXC] bash: ./WebServer: cannot execute binary file: Exec format error #22945

Closed
albertoZurini opened this issue Nov 30, 2017 · 5 comments
Closed
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@albertoZurini
Copy link

I've just finished my web server in Golang, so I moved the build from my PC (Ubuntu 17.04) to the server (Ubuntu 16.04 @ LXC container). The problem is that when I try to run the binary I get Exec format error.
I think it's an issue of LXC, because I've tried running the build on another computer (Ubuntu 17.04) and it runs.
So I've tried installing golang-go on the server too, but naturally nothing has changed. I've also tried building the package with the standard command (go build main.go) and with this other: env GOOS=linux GOARCH=amd64 go build -v, but none of the two has worked.

go env (my pc):

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/Core/Desktop/WebServer"
GORACE=""
GOROOT="/usr/lib/go-1.7"
GOTOOLDIR="/usr/lib/go-1.7/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build647576757=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

go env (server):

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/"
GORACE=""
GOROOT="/usr/lib/go-1.6"
GOTOOLDIR="/usr/lib/go-1.6/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

@bradfitz
Copy link
Contributor

Are you sure your server is 64-bit? Run uname -a.

@albertoZurini
Copy link
Author

Yes, it is 64 bit, Proxmox runs only on x64 CPUs.

@davecheney
Copy link
Contributor

davecheney commented Dec 1, 2017 via email

@bradfitz bradfitz added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Dec 1, 2017
@albertoZurini
Copy link
Author

root@webserver:/home/web# ldd main
ldd: exited with unknown exit code (135)

@bradfitz
Copy link
Contributor

bradfitz commented Dec 5, 2017

Sorry, your environment just seems screwed up. I would bring this to some LXC mailing list.

Closing as there's no evidence there's a Go bug here.

@bradfitz bradfitz closed this as completed Dec 5, 2017
@golang golang locked and limited conversation to collaborators Dec 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants