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

"signal: killed" or "Killed: 9" running on OSX Sierra #339

Closed
theothertomelliott opened this issue Mar 29, 2017 · 7 comments
Closed

"signal: killed" or "Killed: 9" running on OSX Sierra #339

theothertomelliott opened this issue Mar 29, 2017 · 7 comments
Labels

Comments

@theothertomelliott
Copy link
Contributor

I started seeing the message "Killed: 9" in a program using gopsutil when building today. This appears to be related to an update to version 8.3 of Xcode's Command Line tools. My program is using the net and process packages.

I can reproduce this (albeit with a different message), with the example from the README:

package main

import (
"fmt"

"github.com/shirou/gopsutil/mem"

)

func main() {
v, _ := mem.VirtualMemory()

// almost every return value is a struct
fmt.Printf("Total: %v, Free:%v, UsedPercent:%f%%\n", v.Total, v.Free, v.UsedPercent)

// convert to JSON. String() is also implemented
fmt.Println(v)

}

Which outputs "signal: killed".

@qiukeren
Copy link

+1 on mac

May be because of today's update of Sierra 10.12.4?

@theothertomelliott
Copy link
Contributor Author

theothertomelliott commented Mar 29, 2017

@qiukeren In my case it was the XCode update. I managed to work around it by uninstalling XCode and installing the 8.2 version of the command line tools from https://developer.apple.com/download/more/. I've not re-installed XCode yet, but will be using 8.2 when I do.

Should hopefully get you up and running until the problem can be root-caused.

@qiukeren
Copy link

qiukeren commented Mar 29, 2017

@theothertomelliott truely, today's update contains sierra update and command line tools update.

I found some similiar issues on killed 9 ,
which is caused by cgo.

this is a TEMP fix:

replace go build with go build -ldflags=-s

@shirou shirou added the wontfix label Mar 30, 2017
@shirou
Copy link
Owner

shirou commented Mar 30, 2017

Thanks for the information.

I think this is a macOS bug, so I labeled this issue wontfix.

@shirou
Copy link
Owner

shirou commented Mar 30, 2017

golang/go#19734

@heidsoft
Copy link

heidsoft commented Apr 6, 2017

@qiukeren thanks go build -ldflags=-s systools.go ok

@shirou
Copy link
Owner

shirou commented Apr 10, 2017

Go 1.8.1 fixes this problem. or , -ldflags=-s can fix also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants