Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: small bug on linux 64-bit first launch [solved]  (Read 3909 times)

Vind

  • Admiral
  • *****
  • Posts: 785
    • View Profile
small bug on linux 64-bit first launch [solved]
« on: February 11, 2019, 11:30:09 PM »

I cant enter activation code unless legacyLauncher turned on in /data/config/settings.json or this error occurs:

2    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Java version: 1.7.0_79 (64-bit)
99   [main] INFO  com.fs.starfarer.settings.StarfarerSettings  - Loading settings
106  [main] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [ABSOLUTE_AND_CWD: null (data/config/settings.json)]
292  [main] ERROR com.fs.starfarer.StarfarerLauncher  - java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
   at com.fs.graphics.DisplayManager.Ò00000(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.detectResolutions(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.<init>(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.createUI(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.main(Unknown Source)
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)
   ... 6 more

After activating the game legacy launcher can be turned off and game starts fine without it.
« Last Edit: February 12, 2019, 03:13:42 PM by Vind »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24112
    • View Profile
Re: small bug on linux 64-bit first launch
« Reply #1 on: February 12, 2019, 08:12:09 AM »

Thank you for the report!

That's... extremely weird, since the code to initialize graphics stuff (which is where this stack trace indicates an error happens) looks to be exactly the same in both cases. It's not even different modules calling the same initialization code, it's just the same exact code, and different paths based on whether it's activated or not are taken after this. At the point where it crashes, it literally hasn't even checked whether the game is activated or not.

Was it consistently crashing or is it possible it was a one-off crash?

Did the launcher actually crash, or did it just print this to the log and then not work in some other way?
Logged

Vind

  • Admiral
  • *****
  • Posts: 785
    • View Profile
Re: small bug on linux 64-bit first launch
« Reply #2 on: February 12, 2019, 10:10:06 AM »

Tried a couple of times with starsector shipped java 7 then with system installed oracle jre 8u202 - same results - game just quits without anything except small menu with fatal:null message. System is freshly installed and no problems with installed nvidia 415.27 drivers so far. Maybe this is my system specific only error - just wanted to post in case someone can stumble upon this too.

Game loads fine without legacy launcher after activation:
2    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Java version: 1.7.0_79 (64-bit)
56   [main] INFO  com.fs.starfarer.settings.StarfarerSettings  - Loading settings
62   [main] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [ABSOLUTE_AND_CWD: null (data/config/settings.json)]
287  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 640x480, 59Hz, 24bpp
288  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 640x480, 75Hz, 24bpp
288  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 800x600, 75Hz, 24bpp
288  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 800x600, 72Hz, 24bpp
288  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 800x600, 56Hz, 24bpp
288  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 800x600, 60Hz, 24bpp
289  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1024x768, 60Hz, 24bpp
289  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1024x768, 75Hz, 24bpp
289  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1024x768, 70Hz, 24bpp
289  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1152x864, 75Hz, 24bpp
289  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1280x1024, 60Hz, 24bpp
290  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1280x800, 59Hz, 24bpp
290  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1280x960, 60Hz, 24bpp
290  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1280x1024, 75Hz, 24bpp
290  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1280x720, 60Hz, 24bpp
290  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1440x900, 59Hz, 24bpp
290  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1680x1050, 59Hz, 24bpp
291  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1920x1080, 99Hz, 24bpp
291  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1920x1080, 119Hz, 24bpp
291  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1920x1080, 84Hz, 24bpp
291  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1920x1080, 144Hz, 24bpp
291  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Found display mode: 1920x1080, 60Hz, 24bpp
292  [main] INFO  com.fs.starfarer.launcher.opengl.GLLauncher  - Assuming native monitor resolution is 1920x1080
378  [Thread-3] INFO  com.fs.graphics.OO0O  - Using refresh rate:60
etc
« Last Edit: February 12, 2019, 10:14:04 AM by Vind »
Logged

Vind

  • Admiral
  • *****
  • Posts: 785
    • View Profile
Re: small bug on linux 64-bit first launch
« Reply #3 on: February 12, 2019, 03:11:55 PM »

I found the reason for this error  - apparently java uses external program to check for resolutions. If xrandr program for X server is missing this error occurs. This xrandr program is not requirement for anything so system not installs it by default - it is just info tool for available monitor resolutions. Without xrandr installed i got this error with it available all is fine. Completely forgot about installing it after getting errors.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24112
    • View Profile
Re: small bug on linux 64-bit first launch [solved]
« Reply #4 on: February 12, 2019, 03:48:00 PM »

Thank you for the info!

This is definitely one of the weirder ones I've seen as far as working/not working being related to activation, but I'm glad you've got it sorted out. This could come in really handy if someone else runs into the same issue.
Logged

kazi

  • Admiral
  • *****
  • Posts: 714
    • View Profile
Re: small bug on linux 64-bit first launch [solved]
« Reply #5 on: June 20, 2019, 08:35:56 PM »

Big thread necro here, but I just encountered this one myself and ran into the same issue. It looks like this one can either be caused by xrandr being missing or launching the game for the first time in Wayland (context: the X display server is slowly being replaced by Wayland, and has just become the default for several Linux distros). Evidently LWJGL is trying to run xrandr and parse its output via regex to determine the screen resolution on Linux. If xrandr is not present or gives funny output (xrandr is a tool for X, and may return be returning weird things on Wayland), LWJGL will fail to return the screen resolution, crashing the launcher.

If you're a user and encounter this error:

* Install xrandr, if you haven't already.
* Log out of your current desktop session, then log in again on an X session (on GNOME, click the little gear icon and select "GNOME on Xorg"). The launcher should work after that (if xrandr is installed). Strangely, this only appears to be necessary for the first launch, after that, the launcher will work on Wayland. (why??????)

On the dev side, the real solution seems to be to upgrade to LWJGL 3 - https://github.com/LWJGL/lwjgl/issues/112 (if you're already using LWJGL 3, then I'm at a loss here). If it can be caused by running on Wayland like I think it is, the error will become more common as more distributions adopt Wayland as a default (Ubuntu hasn't yet, which is the big one in terms of Linux users).
Logged

DePingus

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: small bug on linux 64-bit first launch [solved]
« Reply #6 on: August 26, 2019, 12:37:24 PM »

Similar (or possibly the same) issue on Fedora 30 64bit with Starsector 0.9.1a-RC8. Xrandr was already installed so that didn't help. When I run the game the launcher opens with no errors but I can't actually see it on any of my desktops. I can see its the foreground app because the title bar says so and I can even see the preview of the launcher if I press the Win key. But I can't actually get to where I can interact with it.

Enabling LegacyLauncher worked for me (though the top portion of the legacy launcher appears off screen and I can't move it). Maybe its got something to do with my multiple monitor setup. Unlike OP, I do have to use the legacy launcher for every start, not just entering the code.
Logged

DePingus

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: small bug on linux 64-bit first launch [solved]
« Reply #7 on: August 29, 2019, 03:01:19 PM »

Adding some info... Just installed it on my Fedora laptop and the regular launcher worked with no issues. So it looks like the issue is with multiple monitors (I'm running 3).
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24112
    • View Profile
Re: small bug on linux 64-bit first launch [solved]
« Reply #8 on: August 29, 2019, 03:07:01 PM »

Thanks for the update! Glad you've at least got some kind of workaround.
Logged