Golang: Error while make test: signal: killed
Asked Answered
S

3

5

I am getting this error while running make test on a Golang project:

signal: killed
FAIL <package name>
make: *** [test] Error 1

The same code was running perfectly fine until yesterday. Note: I tried doing make test on other branches also but same result.

Shepherd answered 29/3, 2017 at 17:21 Comment(5)
Maybe try running specific tests to figure out which one is causing a panic?Kotto
Does you project use cgo, and are you using Xcode8.3?Lota
I'm hitting this error, and yeah, using cgo with xcode cli tools 8.3. Did that introduce a problem?Mailable
Yes my project uses cgo. And I also have xcode 8.3 installed, but not using it in this project. @LotaShepherd
Seems to be a known issue: github.com/golang/go/issues/19734Mailable
D
9

UPDATE on 04/27/2017:

The new Go1.8.1 (released 2017/04/07) fixed this issue. Please download and install the latest version.

OLD ANSWER:

Mainly the reason was that Command Line Tool 8.3 is not compatible.

According to the solutions from https://github.com/golang/go/issues/19734:

OR

  • use -ldflags -s option for compilation or run
Determinative answered 5/4, 2017 at 15:43 Comment(0)
S
1

Thanks a lot @JimB

I uninstalled the Xcode and it runs fine now. Weird !

Shepherd answered 29/3, 2017 at 17:47 Comment(0)
D
0

I've been checking this problem and I'll try to share all the options so you can have everything in a single message: If you don't need Xcode, Removing it will solve the issue.

But in case you need Xcode you can try:

  1. sudo rm -rf /Library/Developer/CommandLineTools. Remove CommandLineTools.
  2. sudo xcode-select -r. This ensures that the system knows where to find the developer tools.
  3. Then xcode-select --install (Reinstall it)
  4. If this doesn't fix it. Try: sudo xcode-select --switch /Applications/Xcode.app/

Another option is a mismatch between Command Line Tools and Xcode versions

➜ ✗  pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 15.3.0.0.1.1708646388
volume: /
location: /
install-time: 1728515565

➜ ✗ xcodebuild -version

Xcode 16.0
Build version 16A242d

After checking this I went to https://developer.apple.com/download/all/?q=Command%20Line and downloaded Command Line Tools for Xcode 16 version. After that:

➜  ✗ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables

package-id: com.apple.pkg.CLTools_Executables
version: 16.0.0.0.1.1724870825
volume: /
location: /
install-time: 1728518012
➜  ✗ xcodebuild -version
Xcode 16.0
Build version 16A242d

and after you can try updating the go version

brew update
brew upgrade go
go version
> go version go1.23.2 darwin/arm64

I'm not sure if updating go only might work but I'm sharing all the attempts so you can try everything until you make it work.

Disabuse answered 10/10 at 0:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.