-
Notifications
You must be signed in to change notification settings - Fork 591
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
Host instrumentation seg faults on start if using go test -race
[MacOS][Sequoia 15.2][M1 ARM][Go 1.23.4]
#6625
Comments
Aside: under Steps to Reproduce, metrics.go, the import line has become mangled with some Markdown. It should be:
You'll also need to set up modules:
But when I do this, I can't reproduce your problem:
Environment: M3 Pro processor, macOS 14.7.2
I then upgraded to |
I'm currently unable to reproduce on the same architecture (Mac M1 Max, Sequoia 15.2, Go 1.23.4). package metrics
import (
_ "go.opentelemetry.io/contrib/instrumentation/host"
) module github.com/dmathieu/experiments/tmp
go 1.23.4
require go.opentelemetry.io/contrib/instrumentation/host v0.58.0
require (
github.com/ebitengine/purego v0.8.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/shirou/gopsutil/v4 v4.24.11 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.9.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel v1.33.0 // indirect
go.opentelemetry.io/otel/metric v1.33.0 // indirect
go.opentelemetry.io/otel/trace v1.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
) dmathieu/experiments/tmp› git:(main) go test -v ./...
testing: warning: no tests to run
PASS
ok github.com/dmathieu/experiments/tmp (cached) [no tests to run] dmathieu/experiments/tmp› git:(main) go test -v -race ./...
testing: warning: no tests to run
PASS
ok github.com/dmathieu/experiments/tmp 1.675s [no tests to run] We also run CI on the macos architecture from GitHub, successfully. latest run. |
OK, I found it. You need to set
|
It looks like the segfault comes from the use of gopsutil. |
Description
Host packages does not work with the race detector, causes a fault on OSX Sequia 15.2 on an m1 due to some type of cgo interaction, which looks like is happening through purego.
You can see thread: https://groups.google.com/g/golang-nuts/c/ay5ngSh8W5A
Environment
host
version: v0.58.0Steps To Reproduce
metrics.go
metrics_test.go
package metrics
go test -race
Even without tests, its going to dump.
Here is the error:
Expected behavior
The test should run or at least tell you that there are no tests to run.
The text was updated successfully, but these errors were encountered: