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

Unhelpful error message when crashing due to missing xrandr binary on linux

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • Minecraft 1.11
    • None
    • Linux, xorg-xrandr not installed
    • Unconfirmed

      LWJGL expects a binary called xrandr to be available and uses it to enumerate its display modes. If xrandr fails lwjgl throws an IndexOutOfBounds exception and Minecraft fails with a rather unhelpful ExceptionInitializerError.

      The relevant error happens in LWJGLs XRandR.java, the process() method specifically, which when it fails causes XRandR.getScreenNames() to return an empty array which causes an exception in LinuxDisplay.java getAvailableDisplayModes() because there's no bounds checking: XRandR.getScreenNames()[0].

      This isn't a problem with minecraft per se and rather an LWJGL issue, but the error message we get makes this hard to fix. I'd propose intercepting a IndexOutOfBounds exception from Display.create() and check if xrandr is an executable command and print a message to the effect of "install this or minecraft won't work" if it's not.

        1. crash-2016-12-06_21.59.49-client.txt
          2 kB
          Hannes Steffenhagen
        2. crashreport.txt
          2 kB
          Hannes Steffenhagen

            Unassigned Unassigned
            hanst99 Hannes Steffenhagen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: