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

Session remains after wayland-logout when a running app is session leader #2336

Open
tyressk opened this issue Apr 18, 2024 · 2 comments
Open
Labels

Comments

@tyressk
Copy link
Contributor

tyressk commented Apr 18, 2024

Describe the bug
Session still shows on loginctl list-sessions as state=Closing if a session leader app is running before wayland-logout is called. One such app is wallock, which ps aux lists as STAT=RLsl and continues running even as wayfire is exited.

To Reproduce
Steps to reproduce the behavior:

  1. Run an app that is a session-leader
  2. Use wayland-logout (or something else that calls SIGTERM)

Expected behavior
Session should exit

Wayfire version
Current master

@tyressk tyressk added the bug label Apr 18, 2024
@ammen99
Copy link
Member

ammen99 commented Apr 18, 2024

What makes you think this is a bug in Wayfire and not in wallock? (i.e what should Wayfire do that it doesn't?)

@tyressk
Copy link
Contributor Author

tyressk commented Apr 18, 2024

Sorry, I don't have much to give on this except that wallock is shut down in Hyprland (kills app and allows it to do its socket removal cleanup). Sway also doesn't kill it.

Actually, my "session leader" theory was wrong too because the app has a --no-daemonize flag that makes it run as RLl+ and it still isn't shut down in wayfire, and since it's the only L process I have running I'm inclined to think it's the memory lock.

I did an interesting experiment though and ran a simple C app that locks the memory:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>

int main() {
    size_t pagesize = getpagesize();
    void* buffer = malloc(pagesize);
    if (buffer == NULL) {
        perror("Failed to allocate memory");
        return 1;
    }

    // Lock the memory
    if (mlock(buffer, pagesize) == -1) {
        perror("Failed to lock memory");
        free(buffer);
        return 1;
    }

    printf("Memory locked");

    // Sleep for 1 hour
    sleep(3600);

    // Unlock the memory
    munlock(buffer, pagesize);
    free(buffer);

    return 0;
}

When I run this alongside wallock, they both get cleaned up when I do wayland-logout on wayfire (not on sway though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants