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

Crash with Flatpak on Fedora 40 on wayland #241

Open
fabmazz opened this issue Oct 9, 2024 · 6 comments
Open

Crash with Flatpak on Fedora 40 on wayland #241

fabmazz opened this issue Oct 9, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@fabmazz
Copy link

fabmazz commented Oct 9, 2024

Describe the bug
The app crashes when starting on Fedora 40 with flatpak. I'm using KDE, and it seems the app cannot connect to the x11 fallback server (although the permission is enabled)

$ flatpak run com.jetpackduba.Gitnuro 
[LOG] OS - OS is linux
log4j:WARN No appenders could be found for logger (org.slf4j).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.awt.HeadlessException: 
No X11 DISPLAY variable was set,
but this program performed an operation which requires it.
        at java.desktop/sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:58)
        at androidx.compose.ui.window.LayoutConfiguration_desktopKt.getGlobalDensity(LayoutConfiguration.desktop.kt:41)
        at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2$1.invoke(Application.desktop.kt:226)
        at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2$1.invoke(Application.desktop.kt:221)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jb.kt:33)
        at androidx.compose.runtime.ActualJvm_jvmKt__ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:36)
        at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(Unknown Source)
        at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3595)
        at androidx.compose.runtime.ComposerImpl.composeContent$runtime(Composer.kt:3522)
        at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:743)
        at androidx.compose.runtime.Recomposer.composeInitial$runtime(Recomposer.kt:1122)
        at androidx.compose.runtime.CompositionImpl.composeInitial(Composition.kt:649)
        at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:635)
        at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2.invokeSuspend(Application.desktop.kt:221)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

To Reproduce
Steps to reproduce the behavior:

  • Start the app on Fedora 40 twice

Expected behavior
The app not to crash on startup of course

Screenshots
I've enabled the following permissions of the flatpak using the Flatseal app:
image

Desktop

  • OS: Fedora 40 KDE
  • Version of the app: 1.4.0
@fabmazz fabmazz added the bug Something isn't working label Oct 9, 2024
@JetpackDuba
Copy link
Owner

Hello!

That's weird! I'm on archlinux with Wayland and works nicely. I'll try to spin up a VM and test it. I'll give you some feedback in a few days.

@JetpackDuba
Copy link
Owner

Hello,

Sorry for the late response. I've tried to run the flatpak version and it worked without issues, however, the jar has shown the exact same error you have described, I'll see what I can do about it.

@fabmazz
Copy link
Author

fabmazz commented Nov 15, 2024

Ok I managed to get some progress.
It seems that the issue was that, on Wayland, the software would try to connect to X11 display first.
By disabling socket=x11 and socket=wayland, then leaving socket=fallback-x11 enabled, the user interface starts.

However, after about 30 seconds the application closes on its own (no bug shown).
Terminal output:

~$ flatpak run com.jetpackduba.Gitnuro
[LOG] OS - OS is linux
log4j:WARN No appenders could be found for logger (org.slf4j).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[LOG] ShellManager - runCommand: which zenity 2>/dev/null
2024-11-15 11:07:16 INFO  slf4j:10 - ShellManager - runCommand: which zenity 2>/dev/null
[LOG] SystemDialogs - IsZenityInstalled true
2024-11-15 11:07:16 INFO  slf4j:10 - SystemDialogs - IsZenityInstalled true
[LOG] ShellManager - runCommand: zenity --file-selection --title=Open --directory
2024-11-15 11:07:16 INFO  slf4j:10 - ShellManager - runCommand: zenity --file-selection --title=Open --directory

Maybe it has to do with KDE, I'll try running it on another desktop.

Running with java -jar Gitnuro-linux-x86_64-1.4.2.jar (so, not from Flatpak) works perfectly

@JetpackDuba
Copy link
Owner

Does it happen when trying to open a folder or it crashes after a while without doing anything in specific? Is your flatpak package updated? I addressed a bug related to a crash in the last release.

@fabmazz
Copy link
Author

fabmazz commented Nov 15, 2024 via email

@JetpackDuba
Copy link
Owner

Could you try v1.4.1?

If no error is shown, it seems like something went wrong out of the JVM. The only 2 parts using native code are the directory watch and the SSH auth. 1.4.1 had a bug where the directory watch wasn't started, so it would help to reduce the possibilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants