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

Ddlm crashes #8

Open
eternal-sorrow opened this issue Jan 23, 2023 · 28 comments
Open

Ddlm crashes #8

eternal-sorrow opened this issue Jan 23, 2023 · 28 comments

Comments

@eternal-sorrow
Copy link

What I get is the screen is flickering as systemd restarts greetd several times. It shows ddlm for a split second and then it shows the VT cursor in the corner of the screen. In the end systemd gives up and I get stuck t the screen that shows DDLM but I cannot interact with it. Furthermore I can't even switch to another TTY. Even after pressing Alt+SysRQ+R. So the only thing that's left for me is to reboot via Alt+SysRQ+REISUB.

After I rebooted and disabled greetd startup with recovery mode, I was able to see the journal, but there was nothing except this error from greetd:

error: check_children: greeter exited without creating a session
@deathowl
Copy link
Owner

I'll check this out as soon as I can, thanks for the report

@deathowl
Copy link
Owner

I checked with the latest build , also with the one from AUR just to be sure. And it works for me. :( Can you make sure greetd(or greeter) user is part of video group? Also could you please attempt running it with RUST_BACKTRACE=1 and capturing the stdout. It would help greatly in debugging

@eternal-sorrow
Copy link
Author

Not soon. Because after I start it, it locks me out of console and I'm unable to do anything except reboot with SysRq.

@eternal-sorrow
Copy link
Author

eternal-sorrow commented Jan 25, 2023

greetd is indeed in the video group. Otherwise it wouldn't work for me before the update. The problem started after #7 this was merged.

@deathowl
Copy link
Owner

maybe try journalctl -u greetd?

@eternal-sorrow
Copy link
Author

That's exactly what I did. There was no errors from DDLM. Just an error from greetd:

error: check_children: greeter exited without creating a session

@deathowl
Copy link
Owner

or make command="exec systemd-cat --identifier=ddlm -- RUST_BACKTRACE=1 ddlm"
then after crashing you can journalctl -t ddlm

@eternal-sorrow
Copy link
Author

I'll try.

@deathowl
Copy link
Owner

sorry.
command = "systemd-cat --identifier=ddlm -- ddlm"

@eternal-sorrow
Copy link
Author

I have command = "ddlm --target=/etc/greetd/run_sway.sh" now.

@deathowl
Copy link
Owner

That might be it. the pr where i backported the session selection + cleanup deprecated the targets flag.
now it consumes ["/usr/share/wayland-sessions", "/usr/share/xsessions"] to select available sessions

@eternal-sorrow
Copy link
Author

Well, that's too bad. Will it at least preselect a session that was used last time? Also, I use a wrapper script to start sway to export the environment variables. Do I need to create a custom session .desktop file for that?

@eternal-sorrow
Copy link
Author

Even better is I could pass a session from command line and don't need to select one during login.

@deathowl
Copy link
Owner

I can readd the flag . And no, last selected session is not saved yet, but will do it once I have time, I'll attempt to do that over the weekend, alongside with the user listing and selection

@eternal-sorrow
Copy link
Author

If it would either remember the selected session end user or take the default values for session and user from command line, that would be perfect for me. Either way is good.

If you re-add the flag to pass a custom script, then session selection should be disabled when this flag is passed.

@eternal-sorrow
Copy link
Author

Ideally I would like to only enter the password to login.

@deathowl
Copy link
Owner

I'll work on saving the last used username and session over the weekend.

@eternal-sorrow
Copy link
Author

eternal-sorrow commented Jan 26, 2023

I tried that trick with systemd-cat and got this error message from ddlm:

thread 'main' panicked at 'unable to enter raw mode: Os { code: 25, kind: Uncategorized, message: "Inappropriate ioctl for device" }', src/main.rs:431:10

@deathowl
Copy link
Owner

there was no changes there since the initial release.

@deathowl
Copy link
Owner

could you ls /usr/share/wayland-sessions and ls /usr/share/xsessions? Because i have a feeling there is something interesting about your installation.

@eternal-sorrow
Copy link
Author

> ls /usr/share/wayland-sessions
sway.desktop
> ls /usr/share/xsessions
ls: cannot access '/usr/share/xsessions': No such file or directory

@hlbstd
Copy link

hlbstd commented Jan 31, 2023

I tried that trick with systemd-cat and got this error message from ddlm:

thread 'main' panicked at 'unable to enter raw mode: Os { code: 25, kind: Uncategorized, message: "Inappropriate ioctl for device" }', src/main.rs:431:10

This message is a consequence of trying to capture the program output with systemd-cat, it hides the actual issue.

@eternal-sorrow
Copy link
Author

So? Is there a way to capture the error output of ddlm without breaking it?

@jfoy
Copy link

jfoy commented Feb 24, 2023

I see this same failure. As a diagnostic, I commented out the let raw = portions of main.rs and was able to generate the following error from ddlm via greetd.

thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', src/main.rs:212:14

@deathowl At a guess, this may not repro for you because you have more than one session file in /usr/share/wayland-sessions (or /usr/share/xsessions)? To test this idea, I added a dummy second file to /usr/share/wayland-sessions and suddenly ddlm stopped crashing at startup.

@eternal-sorrow That may give you a usable workaround.

@deathowl
Copy link
Owner

Thank you! Now this is something that I can look into fixing

@eternal-sorrow
Copy link
Author

Shouldn't Rust prevent this kind of crashes by design?

@deathowl
Copy link
Owner

the contents of the file with xsessions and wlsessions of your machine are not known on compile time, so i doubt Rust provides any extra safety here

@rytec-nl
Copy link

rytec-nl commented Aug 7, 2023

I ran into the same issue because the session folders are not present on my NixOs machine. I reinstated the --target flag in my fork here. I made is so that it works next to the session files (I cannot test that as I don't have those myself). If you want I will create a pull request, I would need to clean it up a bit as I added some NixOS files (a flake for devenv).

Let me know!

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

No branches or pull requests

5 participants