mojira.dev
MC-116952

Can't read CPU info and shows 'CPU: <unknown>' in the debug screen (F3)

The bug

CPU shows <unknown> at debug screen.

Steps to reproduce

Press F3

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1 and 17w18b decompiled using CFR

It looks like the used libraries and methods to detect the CPU changed:

1.11.2

oshi-project:oshi-core:1.1

net.minecraft.client.renderer.OpenGlHelper.initializeTextures() (1.11.2, MCP name)

Processor[] aprocessor = (new SystemInfo()).getHardware().getProcessors();
cpu = String.format("%dx %s", new Object[] {Integer.valueOf(aprocessor.length), aprocessor[0]}).replaceAll("\\s+", " ");

17w18b

com.github.oshi:oshi-core:3.4.2

chp.a() (17w18b)

CentralProcessor centralProcessor = new SystemInfo().getHardware().getProcessor();
ab = String.format("%dx %s", new Object[]{centralProcessor.getPhysicalProcessorCount(), centralProcessor}).replaceAll("\\s+", " ");

The problem appears to be that (at least) one library is missing: org/slf4j/LoggerFactory
This can be seen by modifiying the method chp.a() to log an error if it cannot detect the CPU (which should be done in the first place!):

[13:00:27] [Client thread/ERROR]: Could not get processor
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
	at oshi.hardware.common.AbstractCentralProcessor.<clinit>(AbstractCentralProcessor.java:43) ~[oshi-core-3.4.2.jar:3.4.2]
	at oshi.hardware.platform.windows.WindowsHardwareAbstractionLayer.getProcessor(WindowsHardwareAbstractionLayer.java:64) ~[oshi-core-3.4.2.jar:3.4.2]
	at chp.a(chp.java:272) [17w18b_custom.jar:?]
	at bhm.ap(SourceFile:446) [17w18b_custom.jar:?]
	at bhm.a(SourceFile:389) [17w18b_custom.jar:?]
	at net.minecraft.client.main.Main.main(SourceFile:123) [17w18b_custom.jar:?]
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
	at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_131]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	... 6 more

Linked issues

Attachments

Comments 6

Could you please include what CPU you have?

I have a quad-core Intel Core i3-5005U CPU @ 2GHz

EDIT: I attached a screenshot of the dxdiag.exe so you can find the specs.

Confirmed here 17w18b. win7 x64

CPU: x4 AMD Athlon(tm) X4 760K Quad Core Processor (What it was detected as previously. Accurate)

[media]

Resolved in 1.12-PRE1

confirmed this bug is resolved in 1.12-pre1

[media]

Alawnely

(Unassigned)

Confirmed

F3, cpu, debugscreen, library

Minecraft 17w18a, Minecraft 17w18b

Minecraft 1.12 Pre-Release 1

Retrieved