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

Partitions on Windows #1396

Closed
1 task
roborobs1023 opened this issue Dec 9, 2022 · 1 comment
Closed
1 task

Partitions on Windows #1396

roborobs1023 opened this issue Dec 9, 2022 · 1 comment

Comments

@roborobs1023
Copy link

roborobs1023 commented Dec 9, 2022

Describe the bug
Getting a invalid memory address or null pointer difference error when running the following code.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0xeaab8a]

goroutine 1 [running]:
github.com/shirou/gopsutil/v3/disk.PartitionsWithContext({0xc000046000?, 0xc0000c9f70?}, 0x69?)
        C:/Users/rtucker/go/pkg/mod/github.com/shirou/gopsutil/v3@v3.22.11/disk/disk_windows.go:107 +0x20a
github.com/shirou/gopsutil/v3/disk.Partitions(...)
        C:/Users/rtucker/go/pkg/mod/github.com/shirou/gopsutil/v3@v3.22.11/disk/disk.go:77
main.CalcDiskSpace()
        E:/Coding/Testing/Go/mxlookup/main.go:319 +0x29
main.main()

To Reproduce

319 parts, _ := disk.Partitions(false)
320 fmt.Println(parts)

Expected behavior
I expected it to return a list of the Partitions as the function does in older versions of the module. However in V3 I'm getting the above error.

Environment (please complete the following information):

  • Windows: Windows 10 Build 1904
@shirou
Copy link
Owner

shirou commented Dec 17, 2022

Ah, you are using v3.22.11. That version has an issue, reverted(#1384) and retracted by (#1386). Please use v3.22.10.

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

No branches or pull requests

2 participants