Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-116952

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

XMLWordPrintable

    • Confirmed

      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
      

        1. 2017-05-03_22.36.22.png
          2017-05-03_22.36.22.png
          324 kB
        2. dxdiag.png
          dxdiag.png
          24 kB
        3. 2017-05-10_21.54.02.png
          2017-05-10_21.54.02.png
          767 kB

            Unassigned Unassigned
            LR G. Alawnely
            Votes:
            6 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: