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

sensors.TemperaturesWithContext() crashes on darwin arm64 #1726

Open
1 task done
sni opened this issue Oct 7, 2024 · 0 comments · May be fixed by #1727
Open
1 task done

sensors.TemperaturesWithContext() crashes on darwin arm64 #1726

sni opened this issue Oct 7, 2024 · 0 comments · May be fixed by #1727

Comments

@sni
Copy link

sni commented Oct 7, 2024

Describe the bug
calling sensors.TemperaturesWithContext(ctx) crashes with sigsegv

To Reproduce

sensors.TemperaturesWithContext(context.TODO())

Expected behavior
I would not expect it to crash obviously

Environment (please complete the following information):

  • Mac OS: [paste the result of sw_vers and uname -a

Happens on the github darwin runner which reports as:

Current runner version: '2.319.1'
Operating System
  macOS
  14.6.1
  23G93
Runner Image
  Image: macos-14-arm64
  Version: 20240922.1

using go:
go version go1.22.7 darwin/arm64

Additional context

I am a but curious why it calls runtime.cgocall() in the end if this version should be without cgo?

Here is the relevant part of the crash output:

SIGSEGV: segmentation violation
PC=0x195daf738 m=8 sigcode=2 addr=0x0
signal arrived during cgo execution

goroutine 22 gp=0x140002501c0 m=8 mp=0x1400006c408 [syscall]:
runtime.cgocall(0x102c775f0, 0x140004b6ea0)
/Users/runner/hostedtoolcache/go/1.22.7/arm64/src/runtime/cgocall.go:157 +0x44 fp=0x140003101c0 sp=0x14000310180 pc=0x102955944
    github.com/ebitengine/purego.RegisterFunc.func4({0x14000494438?, 0x1?, 0x1?})
/Users/runner/go/pkg/mod/github.com/ebitengine/purego@v0.8.0/func.go:320 +0x938 fp=0x14000310640 sp=0x140003101c0 pc=0x102c74208
    reflect.callReflect(0x14000469d70, 0x14000310c18, 0x14000310a78, 0x14000310a80)
/Users/runner/hostedtoolcache/go/1.22.7/arm64/src/reflect/value.go:782 +0x3e8 fp=0x14000310a20 sp=0x14000310640 pc=0x1029fb7a8
    reflect.callReflect(0x14000469d70, 0x14000310c18, 0x14000310a78, 0x14000310a80)
<autogenerated>:1 +0x28 fp=0x14000310a50 sp=0x14000310a20 pc=0x102a0bcd8
    reflect.makeFuncStub()
/Users/runner/hostedtoolcache/go/1.22.7/arm64/src/reflect/asm_arm64.s:48 +0x58 fp=0x14000310c10 sp=0x14000310a50 pc=0x102a07ce8
    github.com/shirou/gopsutil/v4/sensors.(*temperatureArm).getProductNames(0x14000311058)
/Users/runner/go/pkg/mod/github.com/shirou/gopsutil/v4@v4.24.9/sensors/sensors_darwin_arm64.go:99 +0x184 fp=0x14000310d20 sp=0x14000310c10 pc=0x102d0f624
    github.com/shirou/gopsutil/v4/sensors.TemperaturesWithContext({0x1038c5be0?, 0x103a985e0?})
/Users/runner/go/pkg/mod/github.com/shirou/gopsutil/v4@v4.24.9/sensors/sensors_darwin_arm64.go:44 +0x33c fp=0x140003111c0 sp=0x14000310d20 pc=0x102d0f02c

(full log is here: https://github.com/ConSol-Monitoring/snclient/actions/runs/11215929181/job/31174213915#step:5:376)

Besides that, i am unable to reproduce it on my m1 mac which is the only mac which i have my hands on.

From a quick search i did not find any unit tests for the actual sensors packages (just a string format test)
I added a unit test: #1725 to see if it crashes here as well.

@uubulb uubulb linked a pull request Oct 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant