Skip to content

Crash on sleep #119

Closed
Closed

Description

@Samueru-sama

We had an issue about crash on sleep that gets fixed when either the appimage is extracted or an alternative runtime is used.

I already had the suspicion because of this other issue I saw at linuxdeploy.

So at this point I'm fairly certain that there is a bug with the runtime causing this.

Activity

  1. probonopd commented on Mar 3, 2025

    @probonopd
    Member

    After looking at pkgforge-dev/ghostty-appimage#27 (comment), it would be interesting to see what happens if the user

    1. Mounts the AppImage using ./Ghostty-1.1.0-x86_64.AppImage --appimage-mount
    2. Goes to sleep
    3. Wakes from sleep
    4. Tries to access the files at the mountpoint - are the files still mounted? Are there errors when opening/reading them? Or is there only an error when trying to run AppRun?

    On which operating systems and sleep modes can this be reproduced?

  2. Samueru-sama commented on Mar 3, 2025

    @Samueru-sama
    Author

    @romainreignier Can you try the above with the AppImage that crashes on sleep?

  3. romainreignier commented on Mar 5, 2025

    @romainreignier

    Hi @probonopd
    I have tried your procedure and once resumed, the temp directory is not there anymore.

    ./Ghostty-1.1.2-x86_64.AppImage --appimage-mount
    /tmp/.mount_GhosttJdaLMk
    
    ls /tmp/.mount_GhosttJdaLMk
    "/tmp/.mount_GhosttJdaLMk": No such file or directory (os error 2)
    

    This is on Kubuntu 22.04.5:

    cat /etc/os-release 
    PRETTY_NAME="Ubuntu 22.04.5 LTS"
    NAME="Ubuntu"
    VERSION_ID="22.04"
    VERSION="22.04.5 LTS (Jammy Jellyfish)"
    VERSION_CODENAME=jammy
    ID=ubuntu
    ID_LIKE=debian
    HOME_URL="https://www.ubuntu.com/"
    SUPPORT_URL="https://help.ubuntu.com/"
    BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
    PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
    UBUNTU_CODENAME=jammy
    

    About the sleep mode, I am not sure. I can tell that if I click on Sleep in KDE and resume a few seconds later, there is no issue.
    But I have a crash every morning with the computer sleeping since the previous end of day.

    See the suspend and resume systemd logs in case you can find anything useful about the sleep mode.

    resume_logs.txt

  4. probonopd commented on Mar 5, 2025

    @probonopd
    Member
  5. probonopd commented on Mar 5, 2025

    @probonopd
    Member

    If you can reproduce the issue using the AppImages from https://github.com/AppImage/appimagetool/releases/tag/continuous, then type2-runtime is also affected and we can reopen this.

  6. Samueru-sama commented on Mar 5, 2025

    @Samueru-sama
    Author

    No @probonopd the issue is happening with the type2-runtime and we fixed it by switching to the uruntime, the appimage with the uruntime no longer crashes on sleep.

    WIth that said I don't know why @romainreignier tested here with version 1.1.2 which there are 3 separate releases and only the oldest one of that one is using the type2-runtime.

    Here we were told that there was no crash anymore on sleep, that artifact is using the uruntime.

    I later asked @romainreignier to test the AppImage that crashes on sleep, which is v1.1.2+1 and uses the type2-runtime and there was no crash anymore. when extracted but it crashes when run normally.

    TLDR:

    • v1.1.2+1 and older crash on sleep unless extracted, these use type2-runtime.

    • v1.1.2+2 and newer do not crash on sleep under any condition, these use uruntime.

  7. Samueru-sama commented on Mar 5, 2025

    @Samueru-sama
    Author

    On top of that I had already seen this issue at linuxdeploy which happened after it was switched to use the static type2-runtime, and in that case the dev says that the crash does not happen when extracted as well.

  8. probonopd commented on Mar 5, 2025

    @probonopd
    Member

    Sorry, my bad. Was tired from dayjob work ;)

  9. probonopd commented on Mar 5, 2025

    @probonopd
    Member

    Can you reproduce the issue using the AppImages from https://github.com/AppImage/appimagetool/releases/tag/continuous though?

  10. Samueru-sama commented on Mar 5, 2025

    @Samueru-sama
    Author

    Can you reproduce the issue using the AppImages from https://github.com/AppImage/appimagetool/releases/tag/continuous though?

    Me? I can't but that's likely because I have one of those chinese X99 motherboards that don't have the ultra slow power states enabled, when I send the PC to sleep it doesn't really go to sleep lol.

    I tried in any case, here is what I was going to test:

    Image

    You can find out if an appimage is using the uruntime by grepping the URUNTIME_MOUNT string which is an internal env variable of it which is not present in the type2-runtime.

    Also notice that the mount point names are different, while the type2-runtime it is .mount_ghosttHlAdkm in the uruntime it is a bunch of numbers .mount_5354263854163925111.

    So @romainreignier was indeed testing the right appimage here because --appimage-mount had the .mount_Ghostt*** output.

  11. romainreignier commented on Mar 6, 2025

    @romainreignier

    Hi @probonopd indeed, I was testing with the version v1.1.2+1 using type2-untime.
    If you need it, how should I use appimagetool-x86_64.AppImage to keep it running while the PC goes to sleep?

  12. probonopd commented on Mar 6, 2025

    @probonopd
    Member

    As above,

    1. appimagetool-x86_64.AppImage --appimage-mount
    2. Go to sleep
    3. Wake from sleep
    4. Try to access the files at the mountpoint - are the files still mounted? Are there errors when opening/reading them? Or is there only an error when trying to run AppRun?
  13. romainreignier commented on Mar 7, 2025

    @romainreignier

    I can confirm the same behavior.

    ./appimagetool-x86_64.AppImage --appimage-mount
    /tmp/.mount_appimabGPOao
    

    After the sleep:

     ls /tmp/.mount_appimabGPOao
    "/tmp/.mount_appimabGPOao": No such file or directory (os error 2)
    
  14. 16 remaining items

  15. probonopd commented on Oct 21, 2025

    @probonopd
    Member

    Come on, it's not that I've deleted it. Just hidden as off-topic.

    If there i a bug in type2-runtime, then that bug needs to be fixed - pointing to inofficial third-party runtimes doesn't really solve it.

    Or, said differently: The "solution" is not to use an inofficial third-party runtime, the solution would be to sit down, reproduce the issue, and submit a PR that resolves this bug in type2 runtime. (If I was still using Linux, I'd probably have solved it by now - but I am not using Linux anymore.)

  16. tresf commented on Oct 21, 2025

    @tresf

    pointing to inofficial third-party runtimes doesn't really solve it.

    It literally solves it... Just not for this project's codebase, specifically (not yet). Workarounds are part of every bug tracker, and knowing the history of why this workaround isn't upstreamed is valuable information. This feels petty and given how much research and explanation went into @Samueru-sama's messages, gives me a very uneasy feeling.

  17. probonopd commented on Oct 21, 2025

    @probonopd
    Member

    Is there a fix for type2-runtime that can be upstreamed? If so, I have missed it.

  18. Samueru-sama commented on Oct 21, 2025

    @Samueru-sama
    Author

    Is there a fix for type2-runtime that can be upstreamed? If so, I have missed it.

    Revert this 😭

  19. probonopd commented on Oct 21, 2025

    @probonopd
    Member

    Thanks @Samueru-sama. 💯 I had missed that indeed.

    Could someone who can reproduce the issue please test with the runtime here:

    If there issue doesn't persist there, then we need to revert #93 and address #92 (which was the reason to introduce it) in some other way.

  20. davidvedvick commented on Oct 22, 2025

    @davidvedvick

    I am not having the issue yet with the reverted runtime and a custom appimage build of LibreWolf, but it's only been a few sleep/resume cycles so far.

  21. davidvedvick commented on Oct 30, 2025

    @davidvedvick

    Still no issues after resume here :)

  22. ivan-hc commented on Oct 30, 2025

    @ivan-hc

    @davidvedvick to reproduce the issue, you should:

    1. set system to sleep after 5 minutes
    2. open the AppImage and leave it opened
    3. do not turn off the PC for any reason
    4. go in the kitchen and cook something, or go out for a walk
    5. go back to the PC and, if it sleeps, awake it

    If the AppImage crashes, this means that the issue is still there. If not, repeat the steps above 2 or 3 times.

  23. probonopd commented on Nov 1, 2025

    @probonopd
    Member

    @Samueru-sama would you be able to confirm that #134 resolves this issue? Thank you very much.

  24. davidvedvick commented on Nov 1, 2025

    @davidvedvick

    @davidvedvick to reproduce the issue, you should:

    1. set system to sleep after 5 minutes
    
    2. open the AppImage and leave it opened
    
    3. do not turn off the PC for any reason
    
    4. go in the kitchen and cook something, or go out for a walk
    
    5. go back to the PC and, if it sleeps, awake it
    

    If the AppImage crashes, this means that the issue is still there. If not, repeat the steps above 2 or 3 times.

    @ivan-hc yes I had this issue repeatedly with the latest version of the runtime. With the reverted runtime, with a version of Librewolf that I built locally, I no longer have this issue.

  25. Samueru-sama commented on Nov 1, 2025

    @Samueru-sama
    Author

    @Samueru-sama would you be able to confirm that #134 resolves this issue? Thank you very much.

    I was never able to replicate the issue as mentioned here

  26. TheAssassin commented on Nov 7, 2025

    @TheAssassin
    Member

    Let's merge this then. I don't think a few stale mountpoints or processes are a huge deal outside some embedded world with limited RAM.

  27. probonopd commented on Nov 8, 2025

    @probonopd
    Member

    Thanks everyone who contributed to the solution, especially @Samueru-sama 👍

  28. probonopd commented on Nov 8, 2025

    @probonopd
    Member

    Please see/test the alternative solution to the original problem, #92:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions