itdelatrisu / opsu

opsu! ~ an open-source osu! client
https://itdelatrisu.github.io/opsu/
GNU General Public License v3.0
764 stars 123 forks source link

** Uncaught Exception! ** #427

Open Derpyhsi opened 6 years ago

Derpyhsi commented 6 years ago

Version: 0.16.0 Build date: 2017-07-02 17:27 OS: Linux (amd64) JRE: 1.8.0_73 Error: ** Uncaught Exception! ** Stack trace:

java.lang.ExceptionInInitializerError
    at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
    at itdelatrisu.opsu.Opsu.main(Opsu.java:205)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    at org.lwjgl.opengl.XRandR.findPrimary(XRandR.java:326)
    at org.lwjgl.opengl.XRandR.ScreentoDisplayMode(XRandR.java:315)
    at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:746)
    at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:743)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:743)
    at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
    ... 4 more
tpenguinltg commented 6 years ago

Are you perhaps trying to run opsu! with sudo? Don't run it with sudo. If it's not that, make sure you have an X session running and you have the DISPLAY environment variable set wherever you're running it.

On that note, I assume this happens on initial load. How are you starting opsu!?

Derpyhsi commented 6 years ago

java -jar "/home/derpyhsi/Games/osu/opsu-0.16.0.jar"

tpenguinltg commented 6 years ago

Sorry, I should have asked for output of echo $DISPLAY and xrandr -q as well.

Derpyhsi commented 6 years ago

Output of echo $DISPLAY :0 Output of xrandr -q

LVDS-1 connected (normal left inverted right x axis y axis)
   1366x768      60.01 +  40.01
   1360x768      59.80    59.96
   1280x720      60.00    59.99    59.86    59.74
   1024x768      60.04    60.00
   960x720       60.00
   928x696       60.05
   896x672       60.01
   1024x576      59.95    59.96    59.90    59.82
   960x600       59.93    60.00
   960x540       59.96    59.99    59.63    59.82
   800x600       60.00    60.32    56.25
   840x525       60.01    59.88
   864x486       59.92    59.57
   800x512       60.17
   700x525       59.98
   800x450       59.95    59.82
   640x512       60.02
   720x450       59.89
   700x450       59.96    59.88
   640x480       60.00    59.94
   720x405       59.51    58.99
   684x384       59.88    59.85
   680x384       59.80    59.96
   640x400       59.88    59.98
   576x432       60.06
   640x360       59.86    59.83    59.84    59.32
   512x384       60.00
   512x288       60.00    59.92
   480x270       59.63    59.82
   400x300       60.32    56.34
   432x243       59.92    59.57
   320x240       60.05
   360x202       59.51    59.13
   320x180       59.84    59.32
VGA-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 800mm x 450mm
   1920x1080     60.00 +  50.00    59.94    30.00    25.00    24.00    29.97    23.98
   1920x1080i    60.00*   60.00    50.00    59.94
   1280x1024     75.02    60.02
   1280x720      60.00    60.00    50.00    59.94
   1024x768      75.03    60.00
   960x600       75.00
   840x525       60.01    59.88                                                                                                                                                                                
   864x486       59.92    59.57
   800x512       60.17
   700x525       59.98
   800x450       59.95    59.82                                      
   640x512       60.02                                     
   720x450       59.89         
   700x450       59.96    59.88
   640x480       60.00    59.94                  
   720x405       59.51    58.99
   684x384       59.88    59.85
   680x384       59.80    59.96
   640x400       59.88    59.98
   576x432       60.06                           
   640x360       59.86    59.83    59.84    59.32
   512x384       60.00                           
   512x288       60.00    59.92         
   480x270       59.63    59.82
   400x300       60.32    56.34
   432x243       59.92    59.57
   320x240       60.05
   360x202       59.51    59.13
   320x180       59.84    59.32
VGA-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 800mm x 450mm
   1920x1080     60.00 +  50.00    59.94    30.00    25.00    24.00    29.97    23.98
   1920x1080i    60.00*   60.00    50.00    59.94
   1280x1024     75.02    60.02
   1280x720      60.00    60.00    50.00    59.94
   1024x768      75.03    60.00
   960x600       75.00
   800x600       75.00    60.32                  
   720x576       50.00
   720x576i      50.00         
   720x480       60.00    59.94
   720x480i      60.00    59.94
   640x480       60.00    59.94
   720x400       70.08
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)
HDMI-3 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)                                   
DP-3 disconnected (normal left inverted right x axis y axis)  
Derpyhsi commented 6 years ago

Also I don't use sudo for running games.

tpenguinltg commented 6 years ago

This is the line that's throwing the error: https://github.com/LWJGL/lwjgl/blob/70a8746f9aa1adaa440b61eb9f2d1b753d8a46f1/src/java/org/lwjgl/opengl/XRandR.java#L326

It looks like there have been some XRandR fixes since the latest release, but unfortunately, there doesn't seem to be a release that captures these fixes. https://github.com/LWJGL/lwjgl/compare/lwjgl2.9.3...master

I'm going to see how I can update LWJGL, and before anyone suggests JitPack, I already tried it and it failed because gcc isn't available on their build servers (here's the log).

tpenguinltg commented 6 years ago

@Derpyhsi I noticed that you're still on 0.16.0. Can you please try the latest version, 0.16.1? I doubt it will fix this, but it's worth a shot anyway. You also appear to be on an older version of Java 8. If updating to 0.16.1 didn't work, can you please try updating Java 8 to the latest (1.8.181, or 8u181)?

(I'm still trying to figure out how to update LWJGL. I haven't had the time to spare yet. If anyone else does, you're free to try.)

Derpyhsi commented 6 years ago
Mon Aug 27 09:01:25 CDT 2018 ERROR:** Uncaught Exception! **
Mon Aug 27 09:01:25 CDT 2018 ERROR:null
java.lang.ExceptionInInitializerError
    at java.lang.J9VMInternals.ensureError(J9VMInternals.java:146)
    at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:135)
    at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
    at java.security.AccessController.doPrivileged(AccessController.java:640)
    at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
    at itdelatrisu.opsu.Opsu.main(Opsu.java:195)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
    at org.lwjgl.opengl.XRandR.findPrimary(XRandR.java:326)
    at org.lwjgl.opengl.XRandR.ScreentoDisplayMode(XRandR.java:315)
    at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:746)
    at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:743)
    at java.security.AccessController.doPrivileged(AccessController.java:640)
    at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:743)
    at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
    ... 4 more
Mon Sep 03 08:11:42 CDT 2018 ERROR:** Uncaught Exception! **
Mon Sep 03 08:11:42 CDT 2018 ERROR:null
java.lang.ExceptionInInitializerError
    at java.lang.J9VMInternals.ensureError(J9VMInternals.java:146)
    at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:135)
    at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
    at java.security.AccessController.doPrivileged(AccessController.java:640)
    at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
    at itdelatrisu.opsu.Opsu.main(Opsu.java:195)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
    at org.lwjgl.opengl.XRandR.findPrimary(XRandR.java:326)
    at org.lwjgl.opengl.XRandR.ScreentoDisplayMode(XRandR.java:315)
    at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:746)
    at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:743)
    at java.security.AccessController.doPrivileged(AccessController.java:640)
    at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:743)
    at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
    ... 4 more
Mon Sep 03 08:12:34 CDT 2018 ERROR:** Uncaught Exception! **
Mon Sep 03 08:12:34 CDT 2018 ERROR:null
java.lang.ExceptionInInitializerError
    at java.lang.J9VMInternals.ensureError(J9VMInternals.java:146)
    at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:135)
    at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
    at java.security.AccessController.doPrivileged(AccessController.java:640)
    at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
    at itdelatrisu.opsu.Opsu.main(Opsu.java:195)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
    at org.lwjgl.opengl.XRandR.findPrimary(XRandR.java:326)
    at org.lwjgl.opengl.XRandR.ScreentoDisplayMode(XRandR.java:315)
    at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:746)
    at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:743)
    at java.security.AccessController.doPrivileged(AccessController.java:640)
    at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:743)
    at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
    ... 4 more
Derpyhsi commented 6 years ago

I tried the new version and this is the error log.

Lyonlancer5 commented 6 years ago

Regarding LWJGL, there was a build of 2.9.4 that was only released thru their CI. Not sure how to include that as a maven source though.

tpenguinltg commented 6 years ago

Oh, perfect. Thanks, @Lyonlancer5. The easy way would be to include the artifact under /repo like we do with YUNPM.

tpenguinltg commented 6 years ago

I opened pull request #434 to update LWJGL. @Derpyhsi: I'd upload a JAR for you to try, but it's too big to attach to a comment. If you can build it yourself, great, but if not, I'll see what I can do (let me know if you need me to do this).

Derpyhsi commented 6 years ago

How would I build this?

tpenguinltg commented 6 years ago

@Derpyhsi

If you already have this repo cloned:

  1. follow the instructions on GitHub's Checking out pull requests locally help doc up until step 7.
  2. follow this project's building instructions in the README. You probably don't need to create a JAR, so follow the instructions for running the project.

If you don't already have this repo cloned, you can instead clone my fork tpenguinltg/opsu and check out the update-lwjgl branch, then follow step 2 above.