Crash at start-up on Linux
- Dominant language
- Kotlin
- Stars
- 3k
- Forks
- 148
- Avg merge
- 13h 44m
- Merged PRs (30d)
- 1
Description
I am unable to run Korge project on Linux after rebooting, it results in the following error:
```
Authorization required, but no authorization protocol specified
Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:108)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at java.desktop/sun.awt.X11GraphicsEnvironment.initStatic(X11GraphicsEnvironment.java:63)
at java.desktop/sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:58)
at java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:68)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:104)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.(GraphicsEnvironment.java:89)
at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:117)
at java.desktop/java.awt.Window.initGC(Window.java:513)
at java.desktop/java.awt.Window.init(Window.java:533)
at java.desktop/java.awt.Window.(Window.java:575)
at java.desktop/java.awt.Frame.(Frame.java:428)
at java.desktop/javax.swing.JFrame.(JFrame.java:224)
at korlibs.render.awt.AwtGameWindow$frame$1.(AwtGameWindow.kt:20)
at korlibs.render.awt.AwtGameWindow.(AwtGameWindow.kt:20)
at korlibs.render.DefaultGameWindowJvmKt.CreateDefaultGameWindow(DefaultGameWindowJvm.kt:8)
at korlibs.korge.KorgeRunner.invoke(Korge.kt:197)
at korlibs.korge.KorgeRunner$invoke$1.invokeSuspend(Korge.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:263)
at kotlinx.coroutines.DispatchedCoroutine.afterResume(Builders.common.kt:255)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:100)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
```
This occurs on Arch Linux and it randomly will work fine again, then refuse to launch.
I have check that the X authentication env is present. This is the only JVM application that exhibits this issue as far as I've encountered.
```
KorGE Forge 2025.2.1.1 (Fenix Edition)
Build #KF-252.25557.SNAPSHOT, built on September 6, 2025 at 06:35
Source revision: 917b28f78c531
Runtime version: 21.0.8+9-b1038.71 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.X11.XToolkit
Linux 6.18.7-arch1-1
Arch Linux; glibc: 2.42
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 8192M
Cores: 12
Registry:
ide.experimental.ui=true
Non-Bundled Plugins:
com.intellij.plugins.vscodekeymap (252.23892.201)
com.nbadal.ktlint (0.30.2)
com.github.copilot (1.5.63-243)
Kotlin: 252.25557.20250906-IJ
Current Desktop: KDE
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with korlibs.render.awt.AwtGameWindow.kt:20 and follow the calls from DefaultGameWindowJvm.kt and Korge.kt in the stack trace. Reproduce the intermittent failure on Arch Linux with the reported DISPLAY and X11 authentication environment, then compare successful and failed launches. Done means the startup failure is explained and the reported configuration launches reliably.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kotlin
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100