-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
host.Users() returns nil on macOS #1510
Comments
perhaps duplicate of #1164. |
On the surface this appears that it may be a duplicate, but the previous issue was closed as deprecation warnings were previously resolved. I have been running this with the latest version of gopsutil to find that these warnings have resurfaced and are causing issues not just with deprecation warnings, but additionally causing values to be returned nil when they previously had been populating as a result. Since this is no longer just depercation warnings, I believe to be a new issue. |
You are not using the latest version of gopsutil as you still import This really is a duplicate #1164. Update gopsutil to its v3. |
Ack, apologies, you are correct: the error (deprecated value returned by macOS) was stemming from the aforementioned missed v3 update in the import. However, it looks like on the updated version of the package, a nil response is still provided regardless of version. I can recreate in a new issue to deconflate these issues if you would like running the initially provided example code: $ go run main.go
# github.com/shirou/gopsutil/host
smc_darwin.c:75:41: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:133:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
[]host.UserStat(nil) running the aforementioned code with the updated import: $ go run main.go
[]host.UserStat(nil) |
|
base64 contents of the dXRtcHgtMS4wMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAczAwMXR0eXMwMDEA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXggAAAgAAADdevVkQeUOAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
Thanks for sharing this data, I could test (on linux) by copying a bunch of definitions to read this example utmpx file. And parsing this file works with the amd64-specific struct definitions, but not with the arm64-specific ones. Can you confirm by testing after copying |
Please change your code like this.
Without specifing version, your code uses I close this issue. If you have other problem, feel free to reopen. Thank you for using gopsutil. |
@Lomanic apologies for the delay in response here (can you please re-openn?) I believe I attempted to do what you asked:
|
Describe the bug
While attempting to retrieve users on macOS, it appears as though the API in macOS previously used has been deprecated. I encountered this issue while recently attempting to run the Users function in the host package (on macOS 13.5).
When I run the function, the following error is provided:
To Reproduce
Expected behavior
It looks like the macOS API has deprecated the previously used call, and should be upgraded to the new endpoint is a rename from Master to Main,
kIOMainPortDefault
.Environment (please complete the following information):
ver
]/etc/os-release
and the result ofuname -a
]ProductName: macOS
ProductVersion: 13.5
BuildVersion: 22G74
Darwin macbook-pro.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000 arm64
freebsd-version -k -r -u
anduname -a
]uname -a
]Additional context
[Cross-compiling? Paste the command you are using to cross-compile and the result of the corresponding
go env
]The text was updated successfully, but these errors were encountered: