Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

system hang after mod+shift+q #224

Closed
guyuming76 opened this issue Apr 7, 2022 · 5 comments
Closed

system hang after mod+shift+q #224

guyuming76 opened this issue Apr 7, 2022 · 5 comments
Labels
A: bug Something isn't working

Comments

@guyuming76
Copy link

guyuming76 commented Apr 7, 2022

i start dwl from tty with dbus-run-session dwl -s foot

when i try to quit dwl with mod+shift+q, system just hang, i cannot even switch tty with ctrl+alt+F#.

after debugging with cgdb, i found that it is because of following code in run method:


	if (startup_cmd) {
		kill(startup_pid, SIGTERM);
		waitpid(startup_pid, NULL, 0);
	}

dwl is blocked at waitpid.

so, i wonder why there should be waitpid call here, what if just send the kill message and continue without waitpid?

if i close the foot VT with exit command and press mod+shift+q, dwl with exit to tty.

@guyuming76 guyuming76 added the A: bug Something isn't working label Apr 7, 2022
@djpohly
Copy link
Owner

djpohly commented Apr 7, 2022

Hm. This could be an interaction with recent changes to reaping. Is the foot process still running at this point? Ideally the program you use for your session manager should exit on receipt of SIGTERM.

@siemato
Copy link
Contributor

siemato commented May 5, 2022

foot has an optional urxvt-style deamon and new wayland clients connect to it as clients. Pure speculation, if that causes the issue though.

@dnkl
Copy link

dnkl commented Jun 13, 2022

I was pinged over at https://codeberg.org/dnkl/foot/issues/651#issuecomment-468120. I'm guessing a bit here, but it looks like dwl is keeping the Wayland socket open, but without actually serving it (obviously, since it's stuck in a waitpid()) .

As long as the Wayland socket is up, foot will exit "nicely"; it will unmap itself and call destroy/release on all the Wayland resources. This wont work if the compositor isn't serving the socket.

I would suggest simply closing the socket before going into the waitpid().

@dnkl
Copy link

dnkl commented Jun 13, 2022

(btw, you can always ping me directly here on github)

@sevz17
Copy link
Collaborator

sevz17 commented Jun 14, 2022

Fixed in d26ddfc
@dnkl, thanks for the hint!

@sevz17 sevz17 closed this as completed Jun 14, 2022
@sevz17 sevz17 mentioned this issue Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants