Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mindustry-wayland crashes #198903

Closed
wanderer opened this issue Nov 1, 2022 · 6 comments
Closed

mindustry-wayland crashes #198903

wanderer opened this issue Nov 1, 2022 · 6 comments
Labels
0.kind: bug Something is broken

Comments

@wanderer
Copy link
Contributor

wanderer commented Nov 1, 2022

Describe the bug

mindustry-wayland crashes when launched

Steps To Reproduce

Simple run mindustry-wayland.

Expected behavior

Should launch the game.

Screenshots

[E] Failed to initialize discord. Enable debug logging for details.
[E] java.lang.ExceptionInInitializerError
	at arc.backend.sdl.SdlGL20.glGetString(SdlGL20.java:36)
	at arc.backend.sdl.SdlGraphics.<init>(SdlGraphics.java:37)
	at arc.backend.sdl.SdlApplication.<init>(SdlApplication.java:34)
	at mindustry.desktop.DesktopLauncher.main(DesktopLauncher.java:36)
Caused by: arc.util.ArcRuntimeException: GLEW failed to initialize: Missing GL version
	at arc.backend.sdl.jni.SDLGL.<clinit>(SDLGL.java:109)
	... 4 more

[E] Failed to save local crash report.: java.lang.NullPointerException: Cannot invoke "mindustry.mod.Mods.list()" because "mindustry.Vars.mods" is null
	at mindustry.net.CrashSender.createReport(CrashSender.java:29)
	at mindustry.net.CrashSender.send(CrashSender.java:92)
	at mindustry.desktop.DesktopLauncher.handleCrash(DesktopLauncher.java:186)
	at mindustry.desktop.DesktopLauncher.main(DesktopLauncher.java:44)

[I] Sending crash report.
java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:660)
	at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:549)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
	at java.base/java.net.Socket.connect(Socket.java:648)
	at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:177)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
	at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
	at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:341)
	at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:362)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1261)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1194)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1082)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1016)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1375)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1350)
	at arc.util.NetJavaImpl.lambda$http$0(NetJavaImpl.java:67)
	at arc.util.async.AsyncExecutor.lambda$submit$2(AsyncExecutor.java:32)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:832)

Additional context

I am using a minimal installation of sway.

Notify maintainers

@fgaz

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.75, NixOS, 22.11 (Raccoon), 22.11.20221029.7f9be6a`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.0`
 - channels(root): `"nixos"`
 - channels(null): `"nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos
@wanderer wanderer added the 0.kind: bug Something is broken label Nov 1, 2022
@wanderer
Copy link
Contributor Author

wanderer commented Nov 1, 2022

I should also note that then normally non-wayland output works fine.

@Tungsten842
Copy link
Member

#200743

@chkno
Copy link
Member

chkno commented Nov 14, 2022

( Some history: Anuken/Mindustry#1393 )

I don't think this problem is related to how mindustry is packaged in nixpkgs. I think this is just a bug in Mindustry / Arc. Mindustry calls glewInit() in a static initializer block in Arc/backends/backend-sdl/src/arc/backend/sdl/jni/SDLGL.java. This is way too early! glewInit() should be called after the GL rendering context is created.

Moving the glewInit call to SdlGraphics' constructor appears to fix the problem.

@chkno
Copy link
Member

chkno commented Nov 14, 2022

I created upstream issue Anuken/Arc#131

@dryya
Copy link

dryya commented Mar 2, 2023

This issue can be closed, mindustry-wayland is working fine on 22.11 and up.

The issue was fixed in Arc commit Anuken/Arc@81877c5, which was released in version 141, and nixpkgs updated to it in #210628.

@fgaz fgaz closed this as completed Mar 7, 2023
@fgaz
Copy link
Member

fgaz commented Mar 7, 2023

Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

5 participants