[pkg-lxc-devel] Bug#857907: lxc: Start/stop with lxc.console=none makes user session crash

Ivan Vilata i Balaguer ivan at selidor.net
Thu Mar 16 10:00:30 UTC 2017


Package: lxc
Version: 1:2.0.7-2
Severity: normal


Hi, I was running a root SSH session from my normal user X11 session.  As
root, I created a simple container with ``lxc-create -t debian -n test3``,
then I edited its config file to set ``lxc.console = none``.  When I started
the container with ``lxc-start -n test3``, my user's X11 session closed
abruptly.  I checked that this happened any time that I entered X11, SSH'd as
root and started or stopped the container.  Removing the ``lxc.console``
option allowed the container to start and stop without issues.

Some messages that may be relevant from ``/var/log/Xorg.0.log``:

```
[  2993.722] (II) UnloadModule: "libinput"
[  2993.722] (II) UnloadModule: "libinput"
[  2993.722] (II) UnloadModule: "libinput"
[  2993.722] (II) UnloadModule: "libinput"
[  2993.722] (II) UnloadModule: "libinput"
[  2993.722] (II) UnloadModule: "libinput"
[  2993.754] (WW) xf86OpenConsole: VT_ACTIVATE failed: Input/output error
[  2993.754] (EE) 
Fatal server error:
[  2993.754] (EE) xf86OpenConsole: Switching VT failed
[  2993.754] (EE) 
[  2993.754] (EE) 
Please consult the The X.Org Foundation support 
         at http://wiki.x.org
 for help. 
[  2993.754] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[  2993.754] (EE) 
[  2993.754] (WW) xf86CloseConsole: KDSETMODE failed: Input/output error
[  2993.754] (WW) xf86CloseConsole: VT_GETMODE failed: Input/output error
[  2993.755] (WW) xf86CloseConsole: VT_ACTIVATE failed: Input/output error
[  2993.755] (EE) Server terminated with error (1). Closing log file.
```

From ``/var/log/messages``:

```
Mar 16 08:39:53 sax kernel: [ 2928.794306] vmbr: port 1(vethREOLEX) entered blocking state
Mar 16 08:39:53 sax kernel: [ 2928.794308] vmbr: port 1(vethREOLEX) entered disabled state
Mar 16 08:39:53 sax kernel: [ 2928.795034] device vethREOLEX entered promiscuous mode
Mar 16 08:39:53 sax kernel: [ 2928.795381] IPv6: ADDRCONF(NETDEV_UP): vethREOLEX: link is not ready
Mar 16 08:39:53 sax kernel: [ 2928.819390] eth0: renamed from veth96O1YH
Mar 16 08:39:53 sax kernel: [ 2928.855946] IPv6: ADDRCONF(NETDEV_CHANGE): vethREOLEX: link becomes ready
Mar 16 08:39:53 sax kernel: [ 2928.856027] vmbr: port 1(vethREOLEX) entered blocking state
Mar 16 08:39:53 sax kernel: [ 2928.856033] vmbr: port 1(vethREOLEX) entered forwarding state
Mar 16 08:40:25 sax kernel: [ 2960.264751] vmbr: port 1(vethREOLEX) entered disabled state
Mar 16 08:40:25 sax kernel: [ 2960.421073] vmbr: port 1(vethREOLEX) entered disabled state
Mar 16 08:40:25 sax kernel: [ 2960.430236] device vethREOLEX left promiscuous mode
Mar 16 08:40:25 sax kernel: [ 2960.430243] vmbr: port 1(vethREOLEX) entered disabled state
Mar 16 08:40:58 sax kernel: [ 2993.194308] vmbr: port 1(vethTSBXBS) entered blocking state
Mar 16 08:40:58 sax kernel: [ 2993.194310] vmbr: port 1(vethTSBXBS) entered disabled state
Mar 16 08:40:58 sax kernel: [ 2993.194505] device vethTSBXBS entered promiscuous mode
Mar 16 08:40:58 sax kernel: [ 2993.194800] IPv6: ADDRCONF(NETDEV_UP): vethTSBXBS: link is not ready
Mar 16 08:40:58 sax kernel: [ 2993.229299] eth0: renamed from vethTAKS6O
Mar 16 08:40:58 sax kernel: [ 2993.255823] IPv6: ADDRCONF(NETDEV_CHANGE): vethTSBXBS: link becomes ready
Mar 16 08:40:58 sax kernel: [ 2993.255881] vmbr: port 1(vethTSBXBS) entered blocking state
Mar 16 08:40:58 sax kernel: [ 2993.255884] vmbr: port 1(vethTSBXBS) entered forwarding state
Mar 16 08:40:58 sax org.a11y.atspi.Registry[5031]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
Mar 16 08:40:58 sax org.a11y.atspi.Registry[5031]:       after 189 requests (189 known processed) with 0 events remaining.
Mar 16 08:40:58 sax org.freedesktop.Notifications[4897]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
Mar 16 08:40:58 sax org.freedesktop.Notifications[4897]:       after 679 requests (679 known processed) with 0 events remaining.
Mar 16 08:40:58 sax udev-acl.ck[20107]: g_slice_set_config: assertion 'sys_page_size == 0' failed
```

When running directly as root from a virtual console (e.g. tty1), stopping the
container shows shutdown messages and closes the host console.  When starting
it, I get the container login on the virtual console, then after a second the
host console, then the container console, and so on…

``lxc.container.conf(5)`` says about ``lxc.console``:

> The keyword 'none' will simply disable the console. This is dangerous once
> if have a rootfs with a console device file where the application can write,
> the messages will fall in the host.

I expected from that warning to get container messages in the host, but not to
have it reset my session.  Maybe a new warning is needed there?

Thank you very much!


-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=ca_ES.UTF-8, LC_CTYPE=ca_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages lxc depends on:
ii  init-system-helpers  1.47
ii  libapparmor1         2.11.0-2
ii  libc6                2.24-9
ii  libcap2              1:2.25-1
ii  libgnutls30          3.5.8-5
ii  liblxc1              1:2.0.7-2
ii  libseccomp2          2.3.1-2.1
ii  libselinux1          2.6-3
ii  lsb-base             9.20161125
ii  python3-lxc          1:2.0.7-2
pn  python3:any          <none>

Versions of packages lxc recommends:
ii  bridge-utils  1.5-13
ii  debootstrap   1.0.89
ii  dirmngr       2.1.18-6
ii  dnsmasq-base  2.76-5+b1
ii  gnupg         2.1.18-6
ii  iptables      1.6.0+snapshot20161117-5
ii  libpam-cgfs   2.0.6-1
ii  lxcfs         2.0.6-1
ii  openssl       1.1.0e-1
ii  rsync         3.1.2-1
ii  uidmap        1:4.4-4

Versions of packages lxc suggests:
ii  apparmor     2.11.0-2
ii  btrfs-tools  4.9.1-1
ii  lvm2         2.02.168-1

-- debconf information:
  lxc/auto: true
  lxc/title:
* lxc/directory: /var/lib/lxc


More information about the Pkg-lxc-devel mailing list