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

Windows: Cannot change thread mode after it is set issue #282

Open
mlugo2 opened this issue Oct 13, 2021 · 2 comments
Open

Windows: Cannot change thread mode after it is set issue #282

mlugo2 opened this issue Oct 13, 2021 · 2 comments
Labels
Milestone

Comments

@mlugo2
Copy link

mlugo2 commented Oct 13, 2021

Hi, I keep getting an error when trying to get any system info.
I've ran the following piece of code with Memory, CPU, GPU and I get the same error:
Code:
memory, err := ghw.Memory() if err != nil { panic(err) }
Error:
panic: Cannot change thread mode after it is set.

The only one which seems to be working is ghw.Topology()

I'm running go 1.17 on Windows 10, any help would be appreciated.

@jaypipes
Copy link
Owner

Hi @mlugo2! Sorry for the delayed response!

Unfortunately, I don't know why that error would show up for you on Windows10/go1.17. I've Googled for the error and I see it show up in a number of libraries where DLLs are being loaded. ghw uses the github.com/StackExchange/wmi library for calling the Windows Management Instrumentation (WMI) interfaces. Apparently that library is no longer being maintained and depends on a slightly older version of the github.com/go-ole/go-ole (v1.2.5). There is a new version of github.com/go-ole/go-ole (v1.2.6) that may have a fix for the thread mode issue.

It may take me a bit, but I will try to add an updated dependency to github.com/go-ole/go-ole v1.2.6 before we hit 1.0.

@jaypipes jaypipes added this to the v1.0.0 milestone Oct 19, 2021
@ffromani
Copy link
Collaborator

We have a CI lane which runs on windows; unfortunately, no win10 is available - we just use what GH make available. I wonder if there is a way to reproduce this issue in our CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants