We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
I can't reproduce this, but I have gotten a few runtime panics with the following:
panic: runtime error: index out of range [1] with length 1 goroutine 66 [running]: github.com/shirou/gopsutil/v4/host.UptimeWithContext({0x1003a53a0?, 0x11011edc0?}) /home/runner/go/pkg/mod/github.com/shirou/gopsutil/v4@v4.24.5/host/host_aix.go:80 +0x510 github.com/shirou/gopsutil/v4/host.BootTimeWithContext({0x1003a53a0?, 0x11011edc0?}) /home/runner/go/pkg/mod/github.com/shirou/gopsutil/v4@v4.24.5/host/host_aix.go:35 +0x3c github.com/shirou/gopsutil/v4/host.InfoWithContext({0x1003a53a0, 0x11011edc0}) /home/runner/go/pkg/mod/github.com/shirou/gopsutil/v4@v4.24.5/host/host.go:96 +0x2d8 github.com/shirou/gopsutil/v4/host.Info(...) /home/runner/go/pkg/mod/github.com/shirou/gopsutil/v4@v4.24.5/host/host.go:62 main.getInfo() /home/runner/work/goagent/goagent/server_details.go:80 +0x38 main.getSystemInfo({0xa00010000482000, 0x14}) /home/runner/work/goagent/goagent/server_details.go:46 +0x40 main.monitorThread() /home/runner/work/goagent/goagent/monitor_thread.go:12 +0x38 created by main.main in goroutine 1 /home/runner/work/goagent/goagent/main.go:35 +0x248
While uptime returns:
# uptime 06:48PM up 2 days, 18:01, 1 user, load average: 1.93, 2.02, 2.11
Which seems to be this line:
minutes, err = strconv.ParseUint(strings.Replace(hm[1], ",", "", -1), 10, 64)
If I see this again I will update + provide a fix
Environment (please complete the following information):
AIX PPC64
The text was updated successfully, but these errors were encountered:
It seems at exactly zero minutes, it returns 'X hrs', not X:00 - silly huh:
2024/06/06 01:47:12 08:47PM up 2 days, 20 hrs, 1 user, load average: 2.47, 2.17, 2.17 panic: runtime error: index out of range [1] with length 1
I will resolve and create a pull request
Sorry, something went wrong.
Fixed in #1663
No branches or pull requests
Describe the bug
I can't reproduce this, but I have gotten a few runtime panics with the following:
While uptime returns:
Which seems to be this line:
minutes, err = strconv.ParseUint(strings.Replace(hm[1], ",", "", -1), 10, 64)
If I see this again I will update + provide a fix
Environment (please complete the following information):
AIX PPC64
The text was updated successfully, but these errors were encountered: