Bug 88381 - Logging out in VT freezes display + input
Summary: Logging out in VT freezes display + input
Status: RESOLVED NOTOURBUG
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-14 01:16 UTC by amosonn
Modified: 2015-02-14 19:47 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description amosonn 2015-01-14 01:16:54 UTC
After repeated switching from X to VT, opening X session there, and closing it,
logging out of the VT left the display and input frozen.

X did not freeze, as audio output remained normal; however, sshd responded but refused opening new sessions.

Journal shows nothing after the line:

Jan 14 02:19:35 arch_amos login[28991]: pam_unix(login:session): session closed for user amos

I'm using arch. Was running Linux version 3.17.6-1-ARCH, systemd 218.
Comment 1 amosonn 2015-01-14 01:55:09 UTC
Similar, maybe related: "too quickly" switching of VTs also freezes system.
Manually starting all vts (systemctl start getty@tty2.service) overcomes this.

Managed to reproduce without opening X on VT - still with sound working for the running X session.

Also, this is the log entry for a functioning logging out of a VT:

Jan 14 03:46:54 arch_amos login[389]: pam_unix(login:session): session closed for user amos
Jan 14 03:46:54 arch_amos systemd[1]: getty@tty1.service has no holdoff time, scheduling restart.

Whereas when a logout freezes system, we get only the first line:

Jan 14 03:47:07 arch_amos login[4323]: pam_unix(login:session): session closed for user amos

and then the log ends.

Both point that the problem might be getty related.
Comment 2 Lennart Poettering 2015-02-04 16:16:25 UTC
what is "frozen" supposed to mean? Does the system react to any kinds of keypresses?

If even sshd hangs, what makes you think this is systemd's fault? Isn't this more likely kernel/driver issue?
Comment 3 amosonn 2015-02-04 16:34:51 UTC
System does not seem to react to keypresses, at least not as far as display is concerned; I will check more thoroughly whether keypresses still go through to the X session, and only display is cut off; however, I think this is not the case.

As far as I understand, systemd is, at least in part, responsible for managing session switches, incl. VT switches. Therefore, since the system still runs (audio output from online streaming continues normally), I assume that systemd somehow denies the X session of access to the display and keyboard, but still intercepts keypresses so a switch to another VT is also impossible.

As I have mentioned, sshd does not completely hang; it does respond to a connection, but fails to open a new session (at least as far as can be inferred from the output on the remote host). As journald logs stop after the fatal logout, I can't tell for sure what happens.

Lastly, this might be related to some issue with getty. However, even in the case where getty hangs, I'd expect systemd to eventually "forcefully" rescind access to display and keyboard and transfer it to the requested VT (that of the X session).
Comment 4 Lennart Poettering 2015-02-04 16:43:11 UTC
(In reply to amosonn from comment #3)
> System does not seem to react to keypresses, at least not as far as display
> is concerned; I will check more thoroughly whether keypresses still go
> through to the X session, and only display is cut off; however, I think this
> is not the case.
> 
> As far as I understand, systemd is, at least in part, responsible for
> managing session switches, incl. VT switches. Therefore, since the system
> still runs (audio output from online streaming continues normally), I assume
> that systemd somehow denies the X session of access to the display and
> keyboard, but still intercepts keypresses so a switch to another VT is also
> impossible.

logind subscribes to VT chnages, and can issue them. But VT change keypress are handled by your display server or by the kernel, logind is not involved.

> As I have mentioned, sshd does not completely hang; it does respond to a
> connection, but fails to open a new session (at least as far as can be
> inferred from the output on the remote host). As journald logs stop after
> the fatal logout, I can't tell for sure what happens.

This feels like a kernel hang of some kind, as userspace appears to be stuck entirely.

Note that pam_systemd on most distros is included in the PAM stack as non-fatal. Thus, whatever happens, if logind is stuck, you can still log in. Given that you cannot login this is likely caused by something else, not logind.
 
> Lastly, this might be related to some issue with getty. However, even in the
> case where getty hangs, I'd expect systemd to eventually "forcefully"
> rescind access to display and keyboard and transfer it to the requested VT
> (that of the X session).

Well, if the entire userspace is dead (which appears to be the case), then logind is dead too.
Comment 5 amosonn 2015-02-04 16:56:56 UTC
I checked, and pam_systemd.so is indeed optional for system-login. I will try reporting this to kernel.

Thanks for your attention!
Comment 6 Zbigniew Jedrzejewski-Szmek 2015-02-14 19:47:06 UTC
This does not seem to be a systemd bug, closing.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.