Panic on macOS Catalina 10.15.7
- Dominant language
- Go
- Stars
- 405
- Forks
- 91
- PR merge metrics
- No merged PRs in 30d
Description
In https://github.com/elastic/go-sysinfo/pull/135 we changed from a custom `sysctl` implementation to the Go stdlib version. There is a kernel bug[^1] in Catalina that causes the stdlib version to return bad data to go-sysinfo. There is issue open in Go to track a possible fix https://github.com/golang/go/issues/60047.
https://github.com/elastic/go-sysinfo/pull/172 adds defensive measures to prevent bad data from causing a panic in go-sysinfo. We probably need another change to revert to the custom `sysctl` implementation for Catalina (darwin/amd64 version 10.15).
[^1]: https://github.com/apple-oss-distributions/xnu/blob/xnu-7195.50.7.100.1/bsd/kern/kern_sysctl.c#L1552-#L1592
```
goroutine 1 [running]:
github.com/elastic/go-sysinfo/providers/darwin.kern_procargs(0xc0003df430?, 0xc0001168c0)
github.com/elastic/go-sysinfo@v1.9.0/providers/darwin/process_darwin.go:207 +0x58f
github.com/elastic/go-sysinfo/providers/darwin.(*process).Info(0xc0001168c0)
github.com/elastic/go-sysinfo@v1.9.0/providers/darwin/process_darwin.go:104 +0x1b4
go.elastic.co/apm/v2.currentProcessTitle()
go.elastic.co/apm/v2@v2.0.0/utils_other.go:34 +0x5f
go.elastic.co/apm/v2.getCurrentProcess()
go.elastic.co/apm/v2@v2.0.0/utils.go:83 +0x65
go.elastic.co/apm/v2.init.1()
go.elastic.co/apm/v2@v2.0.0/utils.go:77 +0x2b
```
https://discuss.elastic.co/t/macos-10-15-7-cannot-execute-filebeat-auditbeat-or-metricbeat/333471
Contributor guide
Assessment
This issue has not been assessed yet.