oshi: WindowsOSProcess.getUser() throws a Win32Exception

Error is:

com.sun.jna.platform.win32.Win32Exception: The parameter is incorrect. at com.sun.jna.platform.win32.Advapi32Util.getAccountBySid(Advapi32Util.java:285) at com.sun.jna.platform.win32.Advapi32Util.getAccountBySid(Advapi32Util.java:251) at com.sun.jna.platform.win32.Advapi32Util.getTokenAccount(Advapi32Util.java:548) at oshi.software.os.windows.WindowsOSProcess.queryUserInfo(WindowsOSProcess.java:360) at oshi.util.Memoizer$1.get(Memoizer.java:87) at oshi.software.os.windows.WindowsOSProcess.getUser(WindowsOSProcess.java:148)

Seems to be similar to https://github.com/oshi/oshi/issues/637, which was fixed by https://github.com/oshi/oshi/pull/641

We were able to reproduce it at using an AWS instance running Windows Server 2016 Datacenter. There seems to be no special steps to reproduce - just run and this will eventually come up.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (12 by maintainers)

Most upvoted comments

I’ve fixed this in ed77b532c79a19ad2c1a21c1ea7060f069c0362f which should be in SNAPSHOT right now. @mfujitaitrs or @rnaval can you please re-test and see if this resolves the issue? If so I’ll submit it upstream to JNA.

Also, the “pointer” 0x6f006f006c0079 is clearly text “ooly”. Curious if that has any relation to a portion of a name of any of your users or domains which would confirm my “losing memory allocation” diagnosis.

I think I’ve identified the problem. Discussing this further on this thread.