Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

"Bad magic number", fails to build #70

Closed
sqs opened this issue May 3, 2015 · 2 comments
Closed

"Bad magic number", fails to build #70

sqs opened this issue May 3, 2015 · 2 comments

Comments

@sqs
Copy link

sqs commented May 3, 2015

Before upgrading from Go 1.4.1 to 1.4.2, goxc worked.

After upgrading, I am unable to successfully build anything:

$ goxc -bc=linux,amd64
[goxc:xc] 2015/05/03 10:07:46 Parallelizing xc for 1 platforms, using max 11 of 12 processors
[goxc:xc] 2015/05/03 10:07:48 File '/home/sqs/bin/sgx-xc/snapshot/linux_amd64/store' is not an ELF file: bad magic number '[33 60 97 114]' in record at byte 0x0
[goxc:xc] 2015/05/03 10:07:48 Error: bad magic number '[33 60 97 114]' in record at byte 0x0
[goxc:xc] 2015/05/03 10:07:48 Something fishy is going on: have you run `goxc -t` for this platform (amd64,linux)???
[goxc:xc] 2015/05/03 10:07:48 Multiple errors (returning first one): [bad magic number '[33 60 97 114]' in record at byte 0x0]
[goxc:xc] 2015/05/03 10:07:48 Stopping after 'xc' failed with error 'bad magic number '[33 60 97 114]' in record at byte 0x0'
[goxc] 2015/05/03 10:07:48 RunTasks error: bad magic number '[33 60 97 114]' in record at byte 0x0

The referenced file (store) is the name of one of my packages; on subsequent goxc runs another seemingly randomly chosen file is the cause of the error (so it doesn't appear to just be this single package).

$ file /home/sqs/bin/sgx-xc/snapshot/linux_amd64/store
/home/sqs/bin/sgx-xc/snapshot/linux_amd64/store: current ar archive

Other info:

$ go version
go version go1.4.2 linux/amd64
$ uname -a
Linux qq 3.13.0-51-generic #84-Ubuntu SMP Wed Apr 15 12:08:34 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ cat .goxc.json 
{
  "AppName": "sgx",
  "Tasks": [
    "xc"
  ],
  "BuildConstraints": "darwin,amd64 linux,amd64",
  "BuildSettings": {
    "Tags": "dist"
  },
  "MainDirsExclude": "Godeps",
  "ConfigVersion": "0.9",
  "Env": [
    "GOPATH={{.Env.PWD}}{{.PS}}Godeps{{.PS}}_workspace{{.PLS}}{{.Env.GOPATH}}"
    ]
}

I have tried reinstalling Go from source. Everything else about my Go installation seems to work fine. I have rerun goxc -t as it mentions (to no avail).

Does the magic number check need to be updated for behavior that changed between Go 1.4.1 and 1.4.2? Anyone else experiencing this issue?

laher added a commit that referenced this issue May 3, 2015
…4.2, and pending changes in 1.5.x. See also #70 and #69
@laher
Copy link
Owner

laher commented May 3, 2015

Hi there, it seems like some subtle compiler changes have happened in Go1.4.2. We're expecting more significant changes in 1.5.0, and maybe more subtle ones in between.

For now I've switched off the magic number check (by default) until I get a chance to look at this properly (but given the changes planned for go1.5.0, I will probably just leave them switched off). Please go get -u latest, and try again.

FYI you can switch the 3 checks back on individually using 'task options'. See goxc -help xc. and goxc xc -verifyExe=true

@sqs
Copy link
Author

sqs commented May 8, 2015

Thank you. This works for me (it no longer fails, of course, and the built binaries work).

@laher laher closed this as completed May 14, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants