shirou / gopsutil

psutil for golang
Other
10.36k stars 1.57k forks source link

stat.Rdev (variable of type uint32) as uint64 #1574

Closed zzdboy closed 6 months ago

zzdboy commented 7 months ago

Describe the bug [A clear and concise description of what the bug is.]

To Reproduce

// paste example code reproducing the bug you are reporting

Expected behavior [A clear and concise description of what you expected to happen.]

Environment (please complete the following information):

Additional context [Cross-compiling? Paste the command you are using to cross-compile and the result of the corresponding go env]

E:\Go\pkg\mod\github.com\shirou\gopsutil\v3@v3.23.12\disk\disk_linux.go:510:22: cannot use stat.Rdev (variable of type uint32) as uint64 value in argument to unix.Major E:\Go\pkg\mod\github.com\shirou\gopsutil\v3@v3.23.12\disk\disk_linux.go:511:22: cannot use stat.Rdev (variable of type uint32) as uint64 value in argument to unix.Minor E:\Go\pkg\mod\github.com\shirou\gopsutil\v3@v3.23.12\disk\disk_linux.go:544:22: cannot use stat.Rdev (variable of type uint32) as uint64 value in argument to unix.Major E:\Go\pkg\mod\github.com\shirou\gopsutil\v3@v3.23.12\disk\disk_linux.go:545:22: cannot use stat.Rdev (variable of type uint32) as uint64 value in argument to unix.Minor

shirou commented 7 months ago

Could you show us those? Thank you.

  1. reproducible code
  2. contents of /etc/os-release and the result of uname -a
  3. what if #1575 applied
CoiaPrant233 commented 7 months ago

https://cs.opensource.google/go/x/sys/+/refs/tags/v0.15.0:unix/ztypes_linux_mips.go#L92

Lines 92

Not all arch of linux is uint64, so must convert it

CoiaPrant233 commented 7 months ago

Could you show us those? Thank you.

  1. reproducible code
  2. contents of /etc/os-release and the result of uname -a
  3. what if [linux][disk]: fix Rdev cast #1575 applied

Please fix this bug quickly

phuonganh2601 commented 6 months ago

Same problem when build project for Mipsle. Temporarily downgrade to version v3.23.10 and problem solved.