Lwjgl bug on archlinux?

Hi,

when I try to run projects, I got the following error immediatly after splash screen :

run:
mai 26, 2017 2:53:22 PM com.jme3.system.JmeDesktopSystem initialize
INFOS: Running on jMonkeyEngine 3.1-stable
 * Branch: HEAD
 * Git Hash: af04bf9
 * Build Date: 2017-02-19
mai 26, 2017 2:53:22 PM com.jme3.app.LegacyApplication handleError
GRAVE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.ExceptionInInitializerError
	at com.jme3.system.lwjgl.LwjglDisplay.createContext(LwjglDisplay.java:112)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:113)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
	at org.lwjgl.opengl.LinuxDisplay.getAvailableDisplayModes(LinuxDisplay.java:951)
	at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:738)
	at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
	... 4 more


Exception: java.lang.NullPointerException thrown from the UncaughtExceptionHandler in thread "jME3 Main"
BUILD SUCCESSFUL (total time: 7 seconds)

I use 3.1-stable, as stack show, and run it on up to date archlinux with gnome. Even the “Basic Game” project throw the error. Error is thrown at the first call to org.lwjgl.opengl.Display class.

Any idea?

I think this bug relates to LWJGL and you can post it on his bug tracker.

You are using the LWJGL2 backend, better to use the LWJGL3 backend as that should be much better.

Lwjgl3 wont Work with our Appsettings Launcher. The Latest Version isnt always the best.

Try to run the game without fullscreen

Runing without fullscreen don’t change anything. I try to run it inside a debian/xfce VM, and it wotk, so it’s an archlinux/lwjgl bug…

I have no problems in archlinux…

I had a similar issue by calling display before starting the app due to when lwjgl was being initialized

After some test, bug is not on archlinux : I repack the project with a Maven shaded jar, and lwjgl don’t crash, without any code change. But I got error :

mai 28, 2017 9:38:50 AM com.jme3.system.JmeDesktopSystem initialize
INFOS: Running on jMonkeyEngine 3.1-stable
 * Branch: HEAD
 * Git Hash: af04bf9
 * Build Date: 2017-02-13
mai 28, 2017 9:38:51 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFOS: LWJGL 3.0.0b SNAPSHOT context running on thread main
 * Graphics Adapter: GLFW 3.2.0 X11 GLX clock_gettime /dev/js XI Xf86vm shared
mai 28, 2017 9:38:51 AM com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
INFOS: OpenGL Renderer Information
 * Vendor: NVIDIA Corporation
 * Renderer: GeForce GTX 1070/PCIe/SSE2
 * OpenGL Version: 3.2.0 NVIDIA 378.13
 * GLSL Version: 1.50 NVIDIA via Cg compiler
 * Profile: Core
X Error of failed request:  RenderBadPicture (invalid Picture parameter)
  Major opcode of failed request:  139 (RENDER)
  Minor opcode of failed request:  7 (RenderFreePicture)
  Picture id in failed request: 0x3e00024
  Serial number of failed request:  3528
  Current serial number in output stream:  3543

It looks like this one is related to the splashscreen : with AppSettings#setShowSettings(false), it do not happen, and everything is fine…

As i said lwjgl3 is incompatibel with that Settings Dialog

Confirmed on Xubuntu 16.04. It is a bug in LWJGL for the version that JME uses, related to the kernel detecting multiple video outputs even if only one monitor is connected.

Ok, but if I launch in SDK the “Basic Game” project, with AppSettings#setShowSettings(false) as the only modification, I got the first error. So this one is not related to splashscreen…

I have the same error, but from the above I’m unsure how to proceed. I have tried various settings in the splash screen, but all give the same result.

To start, where do I set

Thanks for any help!

In your main method, you need to completly disable the splashscreen, using the methid above.

Not sure how to put that exact line in my main method, so I did

public static void main(String[] args) {
    Main app = new Main();
    app.setShowSettings(false);
    app.start();
}

In any case, it gives the same result. Is there anything else I should try?

Which one of the error you’ve got, first or second?

This:

mei 30, 2017 1:17:54 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.1-stable
 * Branch: HEAD
 * Git Hash: af04bf9
 * Build Date: 2017-02-19
mei 30, 2017 1:17:54 PM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.ExceptionInInitializerError
	at com.jme3.system.lwjgl.LwjglDisplay.createContext(LwjglDisplay.java:112)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:113)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
	at org.lwjgl.opengl.LinuxDisplay.getAvailableDisplayModes(LinuxDisplay.java:951)
	at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:738)
	at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
	... 4 more

When using Maven instead of Ant, as @Cafeinoman suggested, I get the same results:

--- exec-maven-plugin:1.2.1:exec (default-cli) @ BasicGame ---
mei 30, 2017 2:27:05 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.1-stable
 * Branch: HEAD
 * Git Hash: af04bf9
 * Build Date: 2017-02-13
mei 30, 2017 2:27:05 PM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.ExceptionInInitializerError
	at com.jme3.system.lwjgl.LwjglDisplay.createContext(LwjglDisplay.java:112)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:113)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
	at org.lwjgl.opengl.LinuxDisplay.getAvailableDisplayModes(LinuxDisplay.java:951)
	at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:738)
	at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
	... 4 more


Exception: java.lang.NullPointerException thrown from the UncaughtExceptionHandler in thread "jME3 Main"
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 7.611s
Finished at: Tue May 30 14:27:09 CEST 2017
Final Memory: 6M/106M
------------------------------------------------------------------------

(Sorry for adding this to a previous post instead of simply replying, but as a new user am I not allowed more than three posts per topic :thinking:).

Ok. I think this one is related to the SDK, or the build. I built my project with maven, and the error gone… it’s a workaround…