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

pkg/cpuid: logs about Linux-specific /proc/cpuinfo missing on macOS #7849

Closed
bradfitz opened this issue Jul 31, 2022 · 4 comments
Closed

pkg/cpuid: logs about Linux-specific /proc/cpuinfo missing on macOS #7849

bradfitz opened this issue Jul 31, 2022 · 4 comments
Labels
type: bug Something isn't working

Comments

@bradfitz
Copy link
Contributor

Description

There a init-time parse of /proc/cpuinfo which isn't conditional on the GOOS.

macOS doesn't have that file, so it shouldn't log a warning about it:

cpuinfob, err := ioutil.ReadFile("/proc/cpuinfo")

This is a regression from some recent-ish refactor. I haven't yet hunted it down.

Steps to reproduce

No response

runsc version

n/a

docker version (if using docker)

n/a

uname

macOS

kubectl (if using Kubernetes)

n/a

repo state (if built from source)

Bug exists at HEAD (f857f26)

runsc debug logs (if available)

No response

@bradfitz
Copy link
Contributor Author

Minimal repro demo:

bradfitz@book1pro gvisor_repro % cat foo.go 
package main

import (
	"fmt"

	_ "gvisor.dev/gvisor/pkg/cpuid"
)

func main() {
	fmt.Println("hi")
}
bradfitz@book1pro gvisor_repro % go run foo.go
W0731 08:27:20.214213   87353 native_arm64.go:52] Could not read /proc/cpuinfo: open /proc/cpuinfo: no such file or directory
W0731 08:27:20.214329   87353 native_arm64.go:177] Could not read /proc/self/auxv: open /proc/self/auxv: no such file or directory
hi
bradfitz@book1pro gvisor_repro % 

@bradfitz
Copy link
Contributor Author

Could you just use https://pkg.go.dev/golang.org/x/sys/cpu instead? At least on darwin?

/cc @dsnet

@bradfitz
Copy link
Contributor Author

I sent #7850 as a proposed workaround for now.

/cc @ayushr2 @kevinGC

@andig
Copy link

andig commented Dec 16, 2022

Seems this has been fixed?

@ayushr2 ayushr2 closed this as completed Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants