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

Incorrect Logical Core/Logical Processor count information #1360

Closed
RajeshPutta87 opened this issue Oct 15, 2020 · 3 comments
Closed

Incorrect Logical Core/Logical Processor count information #1360

RajeshPutta87 opened this issue Oct 15, 2020 · 3 comments
Labels
confirmed bug Confirmed bugs. Highest priority to fix. good first issue Good issues for new contributors to work on

Comments

@RajeshPutta87
Copy link

I am from AppDynamics. We are using OSHI 5.1.0 to retrieve CPU, Memory, Processor, Process information and the environment in use is name=Windows, release=Microsoft Windows Server 2016 Standard, architecture=64-bit

Environment in test is having

64 physical cores
128 logical cores/logical processors

OSHI is incorrectly reporting logical cores as 126 instead of 128. Please refer to attached screenshots and processor details

Can you please look into the issue.

image010
processor.txt

Thanks
Rajesh

@dbwiddis
Copy link
Member

dbwiddis commented Oct 15, 2020

OK, I've tracked this one down to this iteration in the LogicalProcessorInformation class:

for (int lp = lowBit; lp <= hiBit; lp++) {
  if ((mask & (1L << lp)) > 0) {
    // adds a core to the list
  }
}

This fails on core 63, which is a long with a 1 followed by 63 zeroes. This works out to Long.MIN_VALUE which is not > 0.

That comparison should be != 0.

@dbwiddis dbwiddis added confirmed bug Confirmed bugs. Highest priority to fix. good first issue Good issues for new contributors to work on hacktoberfest Issues we're happy for new #Hacktoberfest2020 participants to do labels Oct 15, 2020
@RajeshPutta87
Copy link
Author

RajeshPutta87 commented Oct 15, 2020

@dbwiddis I have made changes to getLogicalProcessorInformation, getBitMatchingPackageNumber, getMatchingCore,getMatchingNumaNode,getMatchingPackage,getLogicalProcessorInformationEx from LogicalProcessorInformation class

Please review it and let me know if that looks fine. I have build the jar with those changes. Also please confirm if those changes fix even #1361

@dbwiddis
Copy link
Member

Resolved in #1362. #1361 is a separate issue that this doesn't fix.

@dbwiddis dbwiddis removed the hacktoberfest Issues we're happy for new #Hacktoberfest2020 participants to do label Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed bug Confirmed bugs. Highest priority to fix. good first issue Good issues for new contributors to work on
Projects
None yet
Development

No branches or pull requests

2 participants