[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-18 Thread Yuan-Chen Cheng
** Changed in: oem-priority
   Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-13 Thread Eric Desrochers
@vicamo,

Seems like you are experiencing the same problem as I experience when being on 
VT-1.
Which was part of the reason why we SRU'd this change to avoid gmd3 to use VT-1 
by default.
The problem can't be reproduce using other VT.

Seems like something acquires VT-1 (systemd ? gdm3 ?) and prevent the VT
switch for VT-1.

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-12 Thread You-Sheng Yang
# Bionic
| |4.15|4.18|4.19
|-|||
|nouveau  |[1] |[2] |[1]
|-|||
|nvidia   |[1] |[1] |[1]

* kernel:
   * 4.15.0-46-generic (bionic)
   * 4.18.0-16-generic (bionic)
   * 4.19.0-13-generic (disco)
* nvidia-driver: 
   * 390.116-0ubuntu0.18.04.1

1. hang in splash
2. reproduce steps for bug 1817738 works, but hangs at switching to VT-1 from 
gnome-shell

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-09 Thread Mathew Hodson
** No longer affects: linux (Ubuntu Bionic)

** No longer affects: linux (Ubuntu)

** Changed in: gdm3 (Ubuntu)
   Importance: Undecided => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-08 Thread You-Sheng Yang
Tested both testppa and proposed:

[UPGRADE] gdm3:amd64 3.28.3-0ubuntu18.04.4 -> 3.28.3-0ubuntu18.04.4+testpkgb1
[UPGRADE] gir1.2-gdm-1.0:amd64 3.28.3-0ubuntu18.04.4 -> 
3.28.3-0ubuntu18.04.4+testpkgb1
[UPGRADE] libgdm1:amd64 3.28.3-0ubuntu18.04.4 -> 3.28.3-0ubuntu18.04.4+testpkgb1

and

[UPGRADE] gdm3:amd64 3.28.3-0ubuntu18.04.4 -> 3.28.3-0ubuntu18.04.5
[UPGRADE] gir1.2-gdm-1.0:amd64 3.28.3-0ubuntu18.04.4 -> 3.28.3-0ubuntu18.04.5
[UPGRADE] libgdm1:amd64 3.28.3-0ubuntu18.04.4 -> 3.28.3-0ubuntu18.04.5

gnome-shell locks up with the same symptoms.

** Tags removed: verification-needed-bionic
** Tags added: verification-failed-bionic

** Tags removed: verification-needed
** Tags added: verification-failed

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-08 Thread You-Sheng Yang
By installing the test packages from PPA
https://launchpad.net/~slashd/+archive/ubuntu/lp1817738, login process
stops at Ubuntu greeting screen and gnome-shell fails to start up
normally. In syslog expecting:

  gnome-shell[1330]: GNOME Shell started at Fri Mar 08 2019 03:09:04
GMT-0500 (EST)

got:

  gnome-shell[1348]: driver/gl/cogl-framebuffer-gl.c:311: GL error (1282): 
Invalid operation
  gnome-shell[1348]: cogl-sampler-cache.c:200: GL error (1280): Invalid 
enumeration value
  gnome-shell[1348]: clutter-offscreen-effect.c:205: Unable to create an 
Offscreen buffer
  gnome-shell[1348]: message repeated 23 times: [ 
clutter-offscreen-effect.c:205: Unable to create an Offscreen buffer]

Still investigating.

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-07 Thread Łukasz Zemczak
Hello Eric, or anyone else affected,

Accepted gdm3 into bionic-proposed. The package will build now and be
available at
https://launchpad.net/ubuntu/+source/gdm3/3.28.3-0ubuntu18.04.5 in a few
hours, and then in the -proposed repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed.  Your feedback will aid us getting this
update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested and change the tag from
verification-needed-bionic to verification-done-bionic. If it does not
fix the bug for you, please add a comment stating that, and change the
tag to verification-failed-bionic. In either case, without details of
your testing we will not be able to proceed.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in
advance for helping!

N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.

** Changed in: gdm3 (Ubuntu Bionic)
   Status: In Progress => Fix Committed

** Tags added: verification-needed verification-needed-bionic

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-07 Thread Yuan-Chen Cheng
** Also affects: oem-priority
   Importance: Undecided
   Status: New

** Changed in: oem-priority
   Importance: Undecided => Critical

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-05 Thread Iain Lane
** Tags removed: rls-bb-incoming

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Eric Desrochers
Uploaded in bionic by desktop team. Thanks.

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Eric Desrochers
Note: Desktop team kindly offered to update the vcs and do the upload in
bionic on my behalf.

Thanks !

** Description changed:

  [Impact]
  
  When AutomaticLogin is enable in gdm3. The "chvt" command hangs forever,
  preventing from changing foreground virtual terminal.
  
  [Test case]
  
  1) Install Bionic/18.04LTS Desktop
  
  2) Enable AutomaticLogin
   2.1) Modify /etc/gdm3/custom.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = 
  
  3) Reboot your system and make sure AutoLogin works by not requesting
  password before opening the  session.
  
- 4) sudo chvt 4 ## chvt will hang here.
+ 4) Print active VT
+ $ sudo fgconsole
+ 
+ Without the fix, it will be "1". # BAD
+ With the fix, it will be "2". # GOOD
+ 
+ 5) sudo chvt 4 ## chvt will hang here.
  
  Verification can be made from a 2nd terminal, run :
  $ cat /proc/$(pidof chvt)/stack
  [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
  [<0>] vt_waitactive+0x80/0xd0
  [<0>] vt_ioctl+0xd26/0x1140
  [<0>] tty_ioctl+0xf6/0x8c0
  [<0>] do_vfs_ioctl+0xa8/0x630
  [<0>] SyS_ioctl+0x79/0x90
  [<0>] do_syscall_64+0x73/0x130
  [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
  [<0>] 0x
  
  It's basically waiting for the VT to be activated, but it never happens.
  
  [Potential regression]
  
  Low.
  
  Current gdm3 run autologin display on tty1. tty1 is really meant for the
  login screen. This commit changes autologin to not use the initial vt.
  
  If one do chvt 1, once in tty1 it will hangs again and one won't be able
  to switch it. tty1 is really the problem here, so by forcing the
  autologin to not use tty1 we improve the current behaviour where we
  can't switch VTs at all when autologin is enabled.
  
  The tty1 behaviour will still need (normal behaviour or not ???) to be
  investigated, but not mandatory required for the sake of this SRU IMHO.
  
  I suspect systemd-logind to be the reason of the tty1 behaviour:
  
  # ps
  root  1350 1  0 Mar03 ?00:00:03 /lib/systemd/systemd-logind
  
  #lsof
  systemd-l  1350   root   24u  CHR4,1  
 0t0 45 /dev/tty1
  
  But I haven't dig much in it for now.
  
  So the fix will works as long as one doesn't do run on tty1.
  
  Exactly like when autologin isn't enable.
  
  * From a machine with autologin enable:
  
  /etc/gdm3/customer.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = user1
  
  $ sudo fgconsole
  1
  
  * From a machine with autologin disable:
  
  /etc/gdm3/customer.conf
  # Enabling automatic login
  #  AutomaticLoginEnable = true
  #  AutomaticLogin = user1
  
  $ sudo fgconsole
  2
  
  [Other information]
  
  * Upstream fix:
  https://github.com/GNOME/gdm/commit/39fb4ff6
  
  $ git describe --contains 39fb4ff6
  3.30.1~2^2~3
  
  $ rmadision gdm3
   ==> gdm3 | 3.28.3-0ubuntu18.04.4   | bionic-updates   | ...
   gdm3 | 3.30.1-1ubuntu5 | cosmic   | ...
   gdm3 | 3.30.1-1ubuntu5 | disco| ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-security  | ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-updates   | ...
   gdm3 | 3.31.4+git20190225-1ubuntu1 | disco-proposed   | ...
  
  [Original Description]
  sudo strace chvt 4
  execve("/bin/chvt", ["chvt", "4"], 0x7ffd63e5c758 /* 17 vars */) = 0
  brk(NULL) = 0x561e1843
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=74655, ...}) = 0
  mmap(NULL, 74655, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5059e7d000
  close(3) = 0
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
  read(3, 
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\34\2\0\0\0\0\0"..., 832) = 
832
  fstat(3, {st_mode=S_IFREG|0755, st_size=2030544, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f5059e7b000
  mmap(NULL, 4131552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f5059878000
  mprotect(0x7f5059a5f000, 2097152, PROT_NONE) = 0
  mmap(0x7f5059c5f000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f5059c5f000
  mmap(0x7f5059c65000, 15072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5059c65000
  close(3) = 0
  arch_prctl(ARCH_SET_FS, 0x7f5059e7c500) = 0
  mprotect(0x7f5059c5f000, 16384, PROT_READ) = 0
  mprotect(0x561e17e87000, 4096, PROT_READ) = 0
  mprotect(0x7f5059e9, 4096, PROT_READ) = 0
  munmap(0x7f5059e7d000, 74655) = 0
  brk(NULL) = 0x561e1843
  brk(0x561e18451000) = 0x561e18451000
  openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, 

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Chris Newcomer
I have a laptop that exhibits this behavior. The switching of the ttys
will hang about 95% of the time (1 in 20). With this test package, it
now works 100% of the time as long as I don't switch to tty1.

I tested it 5 times in a row with a reboot between each.

I can Ctrl+Alt+F# without any issue.

If I run "sudo chvt 1", it will not switch out of that tty again until I
reboot my laptop again. Using 2 through 12 all work and switch the
display to that tty.

Thanks,
Chris Newcomer

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Eric Desrochers
** Description changed:

  [Impact]
  
  When AutomaticLogin is enable in gdm3. The "chvt" command hangs forever,
  preventing from changing foreground virtual terminal.
  
  [Test case]
  
  1) Install Bionic/18.04LTS Desktop
  
  2) Enable AutomaticLogin
   2.1) Modify /etc/gdm3/custom.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = 
  
  3) Reboot your system and make sure AutoLogin works by not requesting
  password before opening the  session.
  
  4) sudo chvt 4 ## chvt will hang here.
  
  Verification can be made from a 2nd terminal, run :
  $ cat /proc/$(pidof chvt)/stack
  [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
  [<0>] vt_waitactive+0x80/0xd0
  [<0>] vt_ioctl+0xd26/0x1140
  [<0>] tty_ioctl+0xf6/0x8c0
  [<0>] do_vfs_ioctl+0xa8/0x630
  [<0>] SyS_ioctl+0x79/0x90
  [<0>] do_syscall_64+0x73/0x130
  [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
  [<0>] 0x
  
  It's basically waiting for the VT to be activated, but it never happens.
  
  [Potential regression]
  
  Low.
  
  Current gdm3 run autologin display on tty1. tty1 is really meant for the
  login screen. This commit changes autologin to not use the initial vt.
  
  If one do chvt 1, once in tty1 it will hangs again and one won't be able
  to switch it. tty1 is really the problem here, so by forcing the
- autologin to not use tty1 we workaround the issue.
+ autologin to not use tty1 we improve the current behaviour where we
+ can't switch VTs at all when autologin is enabled.
  
  The tty1 behaviour will still need (normal behaviour or not ???) to be
  investigated, but not mandatory required for the sake of this SRU IMHO.
  
  I suspect systemd-logind to be the reason of the tty1 behaviour:
  
  # ps
  root  1350 1  0 Mar03 ?00:00:03 /lib/systemd/systemd-logind
  
  #lsof
  systemd-l  1350   root   24u  CHR4,1  
 0t0 45 /dev/tty1
  
  But I haven't dig much in it for now.
  
- So the fix will works as long as one doesn't do "chvt 1", which is
- better than right now where autologin in gdm by default uses tty1 and
- prevent any kind of vt switch.
+ So the fix will works as long as one doesn't do run on tty1.
  
  Exactly like when autologin isn't enable.
  
  * From a machine with autologin enable:
  
  /etc/gdm3/customer.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = user1
  
  $ sudo fgconsole
  1
  
  * From a machine with autologin disable:
  
  /etc/gdm3/customer.conf
  # Enabling automatic login
  #  AutomaticLoginEnable = true
  #  AutomaticLogin = user1
  
  $ sudo fgconsole
  2
  
  [Other information]
  
  * Upstream fix:
  https://github.com/GNOME/gdm/commit/39fb4ff6
  
  $ git describe --contains 39fb4ff6
  3.30.1~2^2~3
  
  $ rmadision gdm3
   ==> gdm3 | 3.28.3-0ubuntu18.04.4   | bionic-updates   | ...
   gdm3 | 3.30.1-1ubuntu5 | cosmic   | ...
   gdm3 | 3.30.1-1ubuntu5 | disco| ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-security  | ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-updates   | ...
   gdm3 | 3.31.4+git20190225-1ubuntu1 | disco-proposed   | ...
  
  [Original Description]
  sudo strace chvt 4
  execve("/bin/chvt", ["chvt", "4"], 0x7ffd63e5c758 /* 17 vars */) = 0
  brk(NULL) = 0x561e1843
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=74655, ...}) = 0
  mmap(NULL, 74655, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5059e7d000
  close(3) = 0
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
  read(3, 
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\34\2\0\0\0\0\0"..., 832) = 
832
  fstat(3, {st_mode=S_IFREG|0755, st_size=2030544, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f5059e7b000
  mmap(NULL, 4131552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f5059878000
  mprotect(0x7f5059a5f000, 2097152, PROT_NONE) = 0
  mmap(0x7f5059c5f000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f5059c5f000
  mmap(0x7f5059c65000, 15072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5059c65000
  close(3) = 0
  arch_prctl(ARCH_SET_FS, 0x7f5059e7c500) = 0
  mprotect(0x7f5059c5f000, 16384, PROT_READ) = 0
  mprotect(0x561e17e87000, 4096, PROT_READ) = 0
  mprotect(0x7f5059e9, 4096, PROT_READ) = 0
  munmap(0x7f5059e7d000, 74655) = 0
  brk(NULL) = 0x561e1843
  brk(0x561e18451000) = 0x561e18451000
  openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=10281936, ...}) = 0
  mmap(NULL, 10281936, 

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Eric Desrochers
** Description changed:

  [Impact]
  
  When AutomaticLogin is enable in gdm3. The "chvt" command hangs forever,
  preventing from changing foreground virtual terminal.
  
  [Test case]
  
  1) Install Bionic/18.04LTS Desktop
  
  2) Enable AutomaticLogin
   2.1) Modify /etc/gdm3/custom.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = 
-  2.2) autologin run on tty1
-   $ sudo fgconsole
- 1
  
  3) Reboot your system and make sure AutoLogin works by not requesting
  password before opening the  session.
  
  4) sudo chvt 4 ## chvt will hang here.
  
  Verification can be made from a 2nd terminal, run :
  $ cat /proc/$(pidof chvt)/stack
  [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
  [<0>] vt_waitactive+0x80/0xd0
  [<0>] vt_ioctl+0xd26/0x1140
  [<0>] tty_ioctl+0xf6/0x8c0
  [<0>] do_vfs_ioctl+0xa8/0x630
  [<0>] SyS_ioctl+0x79/0x90
  [<0>] do_syscall_64+0x73/0x130
  [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
  [<0>] 0x
  
  It's basically waiting for the VT to be activated, but it never happens.
- A system which runs on tty1 is not able to switch VT. This may or may not be 
a kernel issue or else. The tty1 will require some investigation, to see if 
it's a normal behaviour or not ... but can be treated as a separate bug.
  
  [Potential regression]
  
  Low.
  
  Current gdm3 run autologin display on tty1. tty1 is really meant for the
  login screen. This commit changes autologin to not use the initial vt.
  
- But if one do chvt 1, once the system runs on tty1 it will hangs again
- and one won't be able to switch it. tty1 is really the problem here, so
- by forcing the autologin to not use tty1 we workaround the issue.
+ If one do chvt 1, once in tty1 it will hangs again and one won't be able
+ to switch it. tty1 is really the problem here, so by forcing the
+ autologin to not use tty1 we workaround the issue.
  
  The tty1 behaviour will still need (normal behaviour or not ???) to be
- investigated, but not mandatory required for the sake of this SRU IMHO
- and can be treated as a separate bug.
+ investigated, but not mandatory required for the sake of this SRU IMHO.
+ 
+ I suspect systemd-logind to be the reason of the tty1 behaviour:
+ 
+ # ps
+ root  1350 1  0 Mar03 ?00:00:03 /lib/systemd/systemd-logind
+ 
+ #lsof
+ systemd-l  1350   root   24u  CHR4,1  
 0t0 45 /dev/tty1
+ 
+ But I haven't dig much in it for now.
  
  So the fix will works as long as one doesn't do "chvt 1", which is
  better than right now where autologin in gdm by default uses tty1 and
  prevent any kind of vt switch.
  
  Exactly like when autologin isn't enable.
  
  * From a machine with autologin enable:
  
  /etc/gdm3/customer.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = user1
  
  $ sudo fgconsole
  1
  
  * From a machine with autologin disable:
  
  /etc/gdm3/customer.conf
  # Enabling automatic login
  #  AutomaticLoginEnable = true
  #  AutomaticLogin = user1
  
  $ sudo fgconsole
  2
  
  [Other information]
  
  * Upstream fix:
  https://github.com/GNOME/gdm/commit/39fb4ff6
  
  $ git describe --contains 39fb4ff6
  3.30.1~2^2~3
  
  $ rmadision gdm3
   ==> gdm3 | 3.28.3-0ubuntu18.04.4   | bionic-updates   | ...
   gdm3 | 3.30.1-1ubuntu5 | cosmic   | ...
   gdm3 | 3.30.1-1ubuntu5 | disco| ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-security  | ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-updates   | ...
   gdm3 | 3.31.4+git20190225-1ubuntu1 | disco-proposed   | ...
  
  [Original Description]
  sudo strace chvt 4
  execve("/bin/chvt", ["chvt", "4"], 0x7ffd63e5c758 /* 17 vars */) = 0
  brk(NULL) = 0x561e1843
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=74655, ...}) = 0
  mmap(NULL, 74655, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5059e7d000
  close(3) = 0
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
  read(3, 
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\34\2\0\0\0\0\0"..., 832) = 
832
  fstat(3, {st_mode=S_IFREG|0755, st_size=2030544, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f5059e7b000
  mmap(NULL, 4131552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f5059878000
  mprotect(0x7f5059a5f000, 2097152, PROT_NONE) = 0
  mmap(0x7f5059c5f000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f5059c5f000
  mmap(0x7f5059c65000, 15072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5059c65000
  close(3) = 0
  

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Eric Desrochers
** Description changed:

  [Impact]
  
  When AutomaticLogin is enable in gdm3. The "chvt" command hangs forever,
  preventing from changing foreground virtual terminal.
  
  [Test case]
  
  1) Install Bionic/18.04LTS Desktop
  
  2) Enable AutomaticLogin
   2.1) Modify /etc/gdm3/custom.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = 
+  2.2) autologin run on tty1
+   $ sudo fgconsole
+ 1
  
  3) Reboot your system and make sure AutoLogin works by not requesting
  password before opening the  session.
  
  4) sudo chvt 4 ## chvt will hang here.
  
  Verification can be made from a 2nd terminal, run :
  $ cat /proc/$(pidof chvt)/stack
  [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
  [<0>] vt_waitactive+0x80/0xd0
  [<0>] vt_ioctl+0xd26/0x1140
  [<0>] tty_ioctl+0xf6/0x8c0
  [<0>] do_vfs_ioctl+0xa8/0x630
  [<0>] SyS_ioctl+0x79/0x90
  [<0>] do_syscall_64+0x73/0x130
  [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
  [<0>] 0x
  
  It's basically waiting for the VT to be activated, but it never happens.
+ A system which runs on tty1 is not able to switch VT. This may or may not be 
a kernel issue or else. The tty1 will require some investigation, but as a 
separate bug.
  
  [Potential regression]
  
  Low.
  
  Current gdm3 run autologin display on tty1. tty1 is really meant for the
  login screen. This commit changes autologin to not use the initial vt.
  
  But if one do chvt 1, once the system runs on tty1 it will hangs again
  and one won't be able to switch it. tty1 is really the problem here, so
  by forcing the autologin to not use tty1 we workaround the issue.
  
  The tty1 behaviour will still need (normal behaviour or not ???) to be
- investigated, but not mandatory required for the sake of this SRU IMHO.
+ investigated, but not mandatory required for the sake of this SRU IMHO
+ and can be treated as a separate bug.
  
  So the fix will works as long as one doesn't do "chvt 1", which is
  better than right now where autologin in gdm by default uses tty1 and
  prevent any kind of vt switch.
  
  Exactly like when autologin isn't enable.
  
  * From a machine with autologin enable:
  
  /etc/gdm3/customer.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = user1
  
  $ sudo fgconsole
  1
  
  * From a machine with autologin disable:
  
  /etc/gdm3/customer.conf
  # Enabling automatic login
  #  AutomaticLoginEnable = true
  #  AutomaticLogin = user1
  
  $ sudo fgconsole
  2
  
  [Other information]
  
  * Upstream fix:
  https://github.com/GNOME/gdm/commit/39fb4ff6
  
  $ git describe --contains 39fb4ff6
  3.30.1~2^2~3
  
  $ rmadision gdm3
   ==> gdm3 | 3.28.3-0ubuntu18.04.4   | bionic-updates   | ...
   gdm3 | 3.30.1-1ubuntu5 | cosmic   | ...
   gdm3 | 3.30.1-1ubuntu5 | disco| ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-security  | ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-updates   | ...
   gdm3 | 3.31.4+git20190225-1ubuntu1 | disco-proposed   | ...
  
  [Original Description]
  sudo strace chvt 4
  execve("/bin/chvt", ["chvt", "4"], 0x7ffd63e5c758 /* 17 vars */) = 0
  brk(NULL) = 0x561e1843
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=74655, ...}) = 0
  mmap(NULL, 74655, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5059e7d000
  close(3) = 0
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
  read(3, 
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\34\2\0\0\0\0\0"..., 832) = 
832
  fstat(3, {st_mode=S_IFREG|0755, st_size=2030544, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f5059e7b000
  mmap(NULL, 4131552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f5059878000
  mprotect(0x7f5059a5f000, 2097152, PROT_NONE) = 0
  mmap(0x7f5059c5f000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f5059c5f000
  mmap(0x7f5059c65000, 15072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5059c65000
  close(3) = 0
  arch_prctl(ARCH_SET_FS, 0x7f5059e7c500) = 0
  mprotect(0x7f5059c5f000, 16384, PROT_READ) = 0
  mprotect(0x561e17e87000, 4096, PROT_READ) = 0
  mprotect(0x7f5059e9, 4096, PROT_READ) = 0
  munmap(0x7f5059e7d000, 74655) = 0
  brk(NULL) = 0x561e1843
  brk(0x561e18451000) = 0x561e18451000
  openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=10281936, ...}) = 0
  mmap(NULL, 10281936, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5058ea9000
  close(3) = 0
  openat(AT_FDCWD, "/proc/self/fd/0", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Eric Desrochers
** Description changed:

  [Impact]
  
  When AutomaticLogin is enable in gdm3. The "chvt" command hangs forever,
  preventing from changing foreground virtual terminal.
  
  [Test case]
  
  1) Install Bionic/18.04LTS Desktop
  
  2) Enable AutomaticLogin
   2.1) Modify /etc/gdm3/custom.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = 
  
  3) Reboot your system and make sure AutoLogin works by not requesting
  password before opening the  session.
  
  4) sudo chvt 4 ## chvt will hang here.
  
  Verification can be made from a 2nd terminal, run :
  $ cat /proc/$(pidof chvt)/stack
  [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
  [<0>] vt_waitactive+0x80/0xd0
  [<0>] vt_ioctl+0xd26/0x1140
  [<0>] tty_ioctl+0xf6/0x8c0
  [<0>] do_vfs_ioctl+0xa8/0x630
  [<0>] SyS_ioctl+0x79/0x90
  [<0>] do_syscall_64+0x73/0x130
  [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
  [<0>] 0x
  
  It's basically waiting for the VT to be activated, but it never happens.
  
  [Potential regression]
  
  Low.
  
  Current gdm3 run autologin display on tty1. tty1 is really meant for the
  login screen. This commit changes autologin to not use the initial vt.
  
- If one do chvt 1, once in tty1 it will hangs again and one won't be able
- to switch it. tty1 is really the problem here, so by forcing the
- autologin to not use tty1 we workaround the issue.
+ But if one do chvt 1, once the system runs on tty1 it will hangs again
+ and one won't be able to switch it. tty1 is really the problem here, so
+ by forcing the autologin to not use tty1 we workaround the issue.
  
  The tty1 behaviour will still need (normal behaviour or not ???) to be
  investigated, but not mandatory required for the sake of this SRU IMHO.
  
  So the fix will works as long as one doesn't do "chvt 1", which is
  better than right now where autologin in gdm by default uses tty1 and
  prevent any kind of vt switch.
  
  Exactly like when autologin isn't enable.
  
  * From a machine with autologin enable:
  
  /etc/gdm3/customer.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = user1
  
  $ sudo fgconsole
  1
  
  * From a machine with autologin disable:
  
  /etc/gdm3/customer.conf
  # Enabling automatic login
  #  AutomaticLoginEnable = true
  #  AutomaticLogin = user1
  
  $ sudo fgconsole
  2
  
  [Other information]
  
  * Upstream fix:
  https://github.com/GNOME/gdm/commit/39fb4ff6
  
  $ git describe --contains 39fb4ff6
  3.30.1~2^2~3
  
  $ rmadision gdm3
   ==> gdm3 | 3.28.3-0ubuntu18.04.4   | bionic-updates   | ...
   gdm3 | 3.30.1-1ubuntu5 | cosmic   | ...
   gdm3 | 3.30.1-1ubuntu5 | disco| ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-security  | ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-updates   | ...
   gdm3 | 3.31.4+git20190225-1ubuntu1 | disco-proposed   | ...
  
  [Original Description]
  sudo strace chvt 4
  execve("/bin/chvt", ["chvt", "4"], 0x7ffd63e5c758 /* 17 vars */) = 0
  brk(NULL) = 0x561e1843
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=74655, ...}) = 0
  mmap(NULL, 74655, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5059e7d000
  close(3) = 0
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
  read(3, 
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\34\2\0\0\0\0\0"..., 832) = 
832
  fstat(3, {st_mode=S_IFREG|0755, st_size=2030544, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f5059e7b000
  mmap(NULL, 4131552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f5059878000
  mprotect(0x7f5059a5f000, 2097152, PROT_NONE) = 0
  mmap(0x7f5059c5f000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f5059c5f000
  mmap(0x7f5059c65000, 15072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5059c65000
  close(3) = 0
  arch_prctl(ARCH_SET_FS, 0x7f5059e7c500) = 0
  mprotect(0x7f5059c5f000, 16384, PROT_READ) = 0
  mprotect(0x561e17e87000, 4096, PROT_READ) = 0
  mprotect(0x7f5059e9, 4096, PROT_READ) = 0
  munmap(0x7f5059e7d000, 74655) = 0
  brk(NULL) = 0x561e1843
  brk(0x561e18451000) = 0x561e18451000
  openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=10281936, ...}) = 0
  mmap(NULL, 10281936, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5058ea9000
  close(3) = 0
  openat(AT_FDCWD, "/proc/self/fd/0", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device)
  close(3) = 0
  openat(AT_FDCWD, 

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Eric Desrochers
** Description changed:

  [Impact]
  
  When AutomaticLogin is enable in gdm3. The "chvt" command hangs forever,
  preventing from changing foreground virtual terminal.
  
  [Test case]
  
  1) Install Bionic/18.04LTS Desktop
  
  2) Enable AutomaticLogin
   2.1) Modify /etc/gdm3/custom.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = 
  
  3) Reboot your system and make sure AutoLogin works by not requesting
  password before opening the  session.
  
  4) sudo chvt 4 ## chvt will hang here.
  
  Verification can be made from a 2nd terminal, run :
  $ cat /proc/$(pidof chvt)/stack
  [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
  [<0>] vt_waitactive+0x80/0xd0
  [<0>] vt_ioctl+0xd26/0x1140
  [<0>] tty_ioctl+0xf6/0x8c0
  [<0>] do_vfs_ioctl+0xa8/0x630
  [<0>] SyS_ioctl+0x79/0x90
  [<0>] do_syscall_64+0x73/0x130
  [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
  [<0>] 0x
  
  It's basically waiting for the VT to be activated, but it never happens.
  
  [Potential regression]
  
  Low.
  
- Current gdm3 run autologin display on tty1 . tty1 is really meant for
- the login screen. This commit changes autologin to not use the initial
- vt.
+ Current gdm3 run autologin display on tty1. tty1 is really meant for the 
login screen. This commit changes autologin to not use the initial vt.
+  
+ If one do chvt 1, once in tty1 it will hangs again and one won't be able to 
switch it. tty1 is really the problem here, so by forcing the autologin to not 
use tty1 we workaround the issue. 
+ 
+ The tty1 behaviour will still need IMHO to be investigated, but not
+ required for the sake of this SRU IMHO.
+ 
+ So the fix will works as long as one doesn't do "chvt 1", which is
+ better than right now where gmd autologin by default uses tty1 and
+ prevent any kind of vt switch.
  
  Exactly like when autologin isn't enable.
  
- From a machine with autologin disable:
+ * From a machine with autologin enable:
+ 
+ /etc/gdm3/customer.conf
+ # Enabling automatic login
+   AutomaticLoginEnable = true
+   AutomaticLogin = user1
+ 
+ $ sudo fgconsole
+ 1
+ 
+ * From a machine with autologin disable:
  
  /etc/gdm3/customer.conf
  # Enabling automatic login
  #  AutomaticLoginEnable = true
  #  AutomaticLogin = user1
  
  $ sudo fgconsole
  2
+ 
  
  [Other information]
  
  * Upstream fix:
  https://github.com/GNOME/gdm/commit/39fb4ff6
  
  $ git describe --contains 39fb4ff6
  3.30.1~2^2~3
  
  $ rmadision gdm3
   ==> gdm3 | 3.28.3-0ubuntu18.04.4   | bionic-updates   | ...
   gdm3 | 3.30.1-1ubuntu5 | cosmic   | ...
   gdm3 | 3.30.1-1ubuntu5 | disco| ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-security  | ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-updates   | ...
   gdm3 | 3.31.4+git20190225-1ubuntu1 | disco-proposed   | ...
  
  [Original Description]
  sudo strace chvt 4
  execve("/bin/chvt", ["chvt", "4"], 0x7ffd63e5c758 /* 17 vars */) = 0
  brk(NULL) = 0x561e1843
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=74655, ...}) = 0
  mmap(NULL, 74655, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5059e7d000
  close(3) = 0
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
  read(3, 
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\34\2\0\0\0\0\0"..., 832) = 
832
  fstat(3, {st_mode=S_IFREG|0755, st_size=2030544, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f5059e7b000
  mmap(NULL, 4131552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f5059878000
  mprotect(0x7f5059a5f000, 2097152, PROT_NONE) = 0
  mmap(0x7f5059c5f000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f5059c5f000
  mmap(0x7f5059c65000, 15072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5059c65000
  close(3) = 0
  arch_prctl(ARCH_SET_FS, 0x7f5059e7c500) = 0
  mprotect(0x7f5059c5f000, 16384, PROT_READ) = 0
  mprotect(0x561e17e87000, 4096, PROT_READ) = 0
  mprotect(0x7f5059e9, 4096, PROT_READ) = 0
  munmap(0x7f5059e7d000, 74655) = 0
  brk(NULL) = 0x561e1843
  brk(0x561e18451000) = 0x561e18451000
  openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=10281936, ...}) = 0
  mmap(NULL, 10281936, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5058ea9000
  close(3) = 0
  openat(AT_FDCWD, "/proc/self/fd/0", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device)
  close(3) = 0
  openat(AT_FDCWD, "/dev/tty", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig 

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Eric Desrochers
** Description changed:

  [Impact]
  
  When AutomaticLogin is enable in gdm3. The "chvt" command hangs forever,
  preventing from changing foreground virtual terminal.
  
  [Test case]
  
  1) Install Bionic/18.04LTS Desktop
  
  2) Enable AutomaticLogin
   2.1) Modify /etc/gdm3/custom.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = 
  
  3) Reboot your system and make sure AutoLogin works by not requesting
  password before opening the  session.
  
  4) sudo chvt 4 ## chvt will hang here.
  
- 5) From a 2nd terminal, run :
-  5.1) cat /proc/$(pidof chvt)/stack
- 
+ Verification can be made from a 2nd terminal, run :
+ $ cat /proc/$(pidof chvt)/stack
  [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
  [<0>] vt_waitactive+0x80/0xd0
  [<0>] vt_ioctl+0xd26/0x1140
  [<0>] tty_ioctl+0xf6/0x8c0
  [<0>] do_vfs_ioctl+0xa8/0x630
  [<0>] SyS_ioctl+0x79/0x90
  [<0>] do_syscall_64+0x73/0x130
  [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
  [<0>] 0x
  
  It's basically waiting for the VT to be activated, but it never happens.
  
  [Potential regression]
  
  Low.
  
  Current gdm3 run autologin display on tty1 . tty1 is really meant for
  the login screen. This commit changes autologin to not use the initial
  vt.
  
  Exactly like when autologin isn't enable.
  
  From a machine with autologin disable:
  
  /etc/gdm3/customer.conf
  # Enabling automatic login
  #  AutomaticLoginEnable = true
  #  AutomaticLogin = user1
  
- $ sudo fgconsole 
+ $ sudo fgconsole
  2
  
  [Other information]
  
  * Upstream fix:
  https://github.com/GNOME/gdm/commit/39fb4ff6
  
  $ git describe --contains 39fb4ff6
  3.30.1~2^2~3
  
  $ rmadision gdm3
   ==> gdm3 | 3.28.3-0ubuntu18.04.4   | bionic-updates   | ...
   gdm3 | 3.30.1-1ubuntu5 | cosmic   | ...
   gdm3 | 3.30.1-1ubuntu5 | disco| ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-security  | ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-updates   | ...
   gdm3 | 3.31.4+git20190225-1ubuntu1 | disco-proposed   | ...
  
  [Original Description]
  sudo strace chvt 4
  execve("/bin/chvt", ["chvt", "4"], 0x7ffd63e5c758 /* 17 vars */) = 0
  brk(NULL) = 0x561e1843
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=74655, ...}) = 0
  mmap(NULL, 74655, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5059e7d000
  close(3) = 0
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
  read(3, 
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\34\2\0\0\0\0\0"..., 832) = 
832
  fstat(3, {st_mode=S_IFREG|0755, st_size=2030544, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f5059e7b000
  mmap(NULL, 4131552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f5059878000
  mprotect(0x7f5059a5f000, 2097152, PROT_NONE) = 0
  mmap(0x7f5059c5f000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f5059c5f000
  mmap(0x7f5059c65000, 15072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5059c65000
  close(3) = 0
  arch_prctl(ARCH_SET_FS, 0x7f5059e7c500) = 0
  mprotect(0x7f5059c5f000, 16384, PROT_READ) = 0
  mprotect(0x561e17e87000, 4096, PROT_READ) = 0
  mprotect(0x7f5059e9, 4096, PROT_READ) = 0
  munmap(0x7f5059e7d000, 74655) = 0
  brk(NULL) = 0x561e1843
  brk(0x561e18451000) = 0x561e18451000
  openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=10281936, ...}) = 0
  mmap(NULL, 10281936, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5058ea9000
  close(3) = 0
  openat(AT_FDCWD, "/proc/self/fd/0", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device)
  close(3) = 0
  openat(AT_FDCWD, "/dev/tty", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device)
  close(3) = 0
  openat(AT_FDCWD, "/dev/tty0", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = 0
  ioctl(3, VT_ACTIVATE, 0x4) = 0
  ioctl(3, VT_WAITACTIVE, 0x4
  
  VT_ACTIVATE will cause a switch to VT number.
  VT_WAITACTIVE will sleep/wait until the specified VT has been activated.
  
  $ sudo cat /proc/$(pidof chvt)/stack
  [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
  [<0>] vt_waitactive+0x80/0xd0
  [<0>] vt_ioctl+0xd26/0x1140
  [<0>] tty_ioctl+0xf6/0x8c0
  [<0>] do_vfs_ioctl+0xa8/0x630
  [<0>] SyS_ioctl+0x79/0x90
  [<0>] do_syscall_64+0x73/0x130
  [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Eric Desrochers
** Description changed:

  [Impact]
  
  When AutomaticLogin is enable in gdm3. The "chvt" command hangs forever,
  preventing from changing foreground virtual terminal.
  
  [Test case]
  
  1) Install Bionic/18.04LTS Desktop
  
  2) Enable AutomaticLogin
   2.1) Modify /etc/gdm3/custom.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = 
  
  3) Reboot your system and make sure AutoLogin works by not requesting
  password before opening the  session.
  
  4) sudo chvt 4 ## chvt will hang here.
  
  5) From a 2nd terminal, run :
   5.1) cat /proc/$(pidof chvt)/stack
  
  [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
  [<0>] vt_waitactive+0x80/0xd0
  [<0>] vt_ioctl+0xd26/0x1140
  [<0>] tty_ioctl+0xf6/0x8c0
  [<0>] do_vfs_ioctl+0xa8/0x630
  [<0>] SyS_ioctl+0x79/0x90
  [<0>] do_syscall_64+0x73/0x130
  [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
  [<0>] 0x
  
  It's basically waiting for the VT to be activated, but it never happens.
  
  [Potential regression]
+ 
+ Low.
+ 
+ Current gdm3 run autologin display on tty1 . tty1 is really meant for
+ the login screen. This commit changes autologin to not use the initial
+ vt.
  
  [Other information]
  
  * Upstream fix:
  https://github.com/GNOME/gdm/commit/39fb4ff6
  
  $ git describe --contains 39fb4ff6
  3.30.1~2^2~3
  
  $ rmadision gdm3
   ==> gdm3 | 3.28.3-0ubuntu18.04.4   | bionic-updates   | ...
   gdm3 | 3.30.1-1ubuntu5 | cosmic   | ...
   gdm3 | 3.30.1-1ubuntu5 | disco| ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-security  | ...
   gdm3 | 3.30.1-1ubuntu5.1   | cosmic-updates   | ...
   gdm3 | 3.31.4+git20190225-1ubuntu1 | disco-proposed   | ...
  
  [Original Description]
  sudo strace chvt 4
  execve("/bin/chvt", ["chvt", "4"], 0x7ffd63e5c758 /* 17 vars */) = 0
  brk(NULL) = 0x561e1843
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=74655, ...}) = 0
  mmap(NULL, 74655, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5059e7d000
  close(3) = 0
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
  read(3, 
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\34\2\0\0\0\0\0"..., 832) = 
832
  fstat(3, {st_mode=S_IFREG|0755, st_size=2030544, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f5059e7b000
  mmap(NULL, 4131552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f5059878000
  mprotect(0x7f5059a5f000, 2097152, PROT_NONE) = 0
  mmap(0x7f5059c5f000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f5059c5f000
  mmap(0x7f5059c65000, 15072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5059c65000
  close(3) = 0
  arch_prctl(ARCH_SET_FS, 0x7f5059e7c500) = 0
  mprotect(0x7f5059c5f000, 16384, PROT_READ) = 0
  mprotect(0x561e17e87000, 4096, PROT_READ) = 0
  mprotect(0x7f5059e9, 4096, PROT_READ) = 0
  munmap(0x7f5059e7d000, 74655) = 0
  brk(NULL) = 0x561e1843
  brk(0x561e18451000) = 0x561e18451000
  openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=10281936, ...}) = 0
  mmap(NULL, 10281936, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5058ea9000
  close(3) = 0
  openat(AT_FDCWD, "/proc/self/fd/0", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device)
  close(3) = 0
  openat(AT_FDCWD, "/dev/tty", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device)
  close(3) = 0
  openat(AT_FDCWD, "/dev/tty0", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = 0
  ioctl(3, VT_ACTIVATE, 0x4) = 0
  ioctl(3, VT_WAITACTIVE, 0x4
  
  VT_ACTIVATE will cause a switch to VT number.
  VT_WAITACTIVE will sleep/wait until the specified VT has been activated.
  
  $ sudo cat /proc/$(pidof chvt)/stack
  [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
  [<0>] vt_waitactive+0x80/0xd0
  [<0>] vt_ioctl+0xd26/0x1140
  [<0>] tty_ioctl+0xf6/0x8c0
  [<0>] do_vfs_ioctl+0xa8/0x630
  [<0>] SyS_ioctl+0x79/0x90
  [<0>] do_syscall_64+0x73/0x130
  [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
  [<0>] 0x
  
  Enable debuglogs doesn't provide additional details.
  
  As soon as auto-login is turned off, chvt is back to normal.
  
  The above has been reproduced on Ubuntu:
  - Ubuntu Bionic w/ gdm3 3.28.3 & kbd 2.0.4

** Description changed:

  [Impact]
  
  When AutomaticLogin is enable in gdm3. The "chvt" command 

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Eric Desrochers
** Description changed:

  [Impact]
  
  When AutomaticLogin is enable in gdm3. The "chvt" command hangs forever,
  preventing from changing foreground virtual terminal.
  
  [Test case]
  
  1) Install Bionic/18.04LTS Desktop
  
  2) Enable AutomaticLogin
-  2.1) Modify /etc/gdm3/custom.conf
+  2.1) Modify /etc/gdm3/custom.conf
  # Enabling automatic login
-   AutomaticLoginEnable = true
-   AutomaticLogin = 
+   AutomaticLoginEnable = true
+   AutomaticLogin = 
  
- 3) Restart gdm or reboot
+ 3) Reboot your system and make sure AutoLogin works by not requesting
+ password before opening the  session.
  
  4) sudo chvt 4 ## chvt will hang here.
  
  5) From a 2nd terminal, run :
-  5.1) cat /proc/$(pidof chvt)/stack
+  5.1) cat /proc/$(pidof chvt)/stack
  
  [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
  [<0>] vt_waitactive+0x80/0xd0
  [<0>] vt_ioctl+0xd26/0x1140
  [<0>] tty_ioctl+0xf6/0x8c0
  [<0>] do_vfs_ioctl+0xa8/0x630
  [<0>] SyS_ioctl+0x79/0x90
  [<0>] do_syscall_64+0x73/0x130
  [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
  [<0>] 0x
  
  It's basically waiting for the VT to be activated, but it never happens.
  
  [Potential regression]
  
  [Other information]
  
  [Original Description]
  sudo strace chvt 4
  execve("/bin/chvt", ["chvt", "4"], 0x7ffd63e5c758 /* 17 vars */) = 0
  brk(NULL) = 0x561e1843
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=74655, ...}) = 0
  mmap(NULL, 74655, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5059e7d000
  close(3) = 0
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
  read(3, 
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\34\2\0\0\0\0\0"..., 832) = 
832
  fstat(3, {st_mode=S_IFREG|0755, st_size=2030544, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f5059e7b000
  mmap(NULL, 4131552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f5059878000
  mprotect(0x7f5059a5f000, 2097152, PROT_NONE) = 0
  mmap(0x7f5059c5f000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f5059c5f000
  mmap(0x7f5059c65000, 15072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5059c65000
  close(3) = 0
  arch_prctl(ARCH_SET_FS, 0x7f5059e7c500) = 0
  mprotect(0x7f5059c5f000, 16384, PROT_READ) = 0
  mprotect(0x561e17e87000, 4096, PROT_READ) = 0
  mprotect(0x7f5059e9, 4096, PROT_READ) = 0
  munmap(0x7f5059e7d000, 74655) = 0
  brk(NULL) = 0x561e1843
  brk(0x561e18451000) = 0x561e18451000
  openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=10281936, ...}) = 0
  mmap(NULL, 10281936, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5058ea9000
  close(3) = 0
  openat(AT_FDCWD, "/proc/self/fd/0", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device)
  close(3) = 0
  openat(AT_FDCWD, "/dev/tty", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device)
  close(3) = 0
  openat(AT_FDCWD, "/dev/tty0", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = 0
  ioctl(3, VT_ACTIVATE, 0x4) = 0
  ioctl(3, VT_WAITACTIVE, 0x4
  
  VT_ACTIVATE will cause a switch to VT number.
  VT_WAITACTIVE will sleep/wait until the specified VT has been activated.
  
  $ sudo cat /proc/$(pidof chvt)/stack
  [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
  [<0>] vt_waitactive+0x80/0xd0
  [<0>] vt_ioctl+0xd26/0x1140
  [<0>] tty_ioctl+0xf6/0x8c0
  [<0>] do_vfs_ioctl+0xa8/0x630
  [<0>] SyS_ioctl+0x79/0x90
  [<0>] do_syscall_64+0x73/0x130
  [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
  [<0>] 0x
  
  Enable debuglogs doesn't provide additional details.
  
  As soon as auto-login is turned off, chvt is back to normal.
  
  The above has been reproduced on Ubuntu:
  - Ubuntu Bionic w/ gdm3 3.28.3 & kbd 2.0.4
  - Ubuntu disco w/ gdm3 3.30.1 & kbd 2.0.4

** Description changed:

  [Impact]
  
  When AutomaticLogin is enable in gdm3. The "chvt" command hangs forever,
  preventing from changing foreground virtual terminal.
  
  [Test case]
  
  1) Install Bionic/18.04LTS Desktop
  
  2) Enable AutomaticLogin
   2.1) Modify /etc/gdm3/custom.conf
  # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = 
  
  3) Reboot your system and make sure AutoLogin works by not requesting
  password before opening the  session.
  
  4) sudo chvt 4 ## chvt will hang here.
  
  5) From a 2nd terminal, run :
   5.1) cat /proc/$(pidof chvt)/stack
  

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Eric Desrochers
I was able to reproduce the bug, and this upstream fix[1] look
promising.

On my test machine, using a test package containing this patch on top of
current gdm3 bionic, chvt doesn't hang anymore, and work as expected.

I'd would like more feedback before I proceed with an SRU.

[1] - 39fb4ff6 manager: don't run autologin display on tty1

- Eric

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Eric Desrochers
** Description changed:

+ [Impact]
+ 
+ When AutomaticLogin is enable in gdm3. The "chvt" command hangs forever,
+ preventing from changing foreground virtual terminal.
+ 
+ [Test case]
+ 
+ 1) Install Bionic/18.04LTS Desktop
+ 
+ 2) Enable AutomaticLogin
+  2.1) Modify /etc/gdm3/custom.conf
+ # Enabling automatic login
+   AutomaticLoginEnable = true
+   AutomaticLogin = 
+ 
+ 3) Restart gdm or reboot
+ 
+ 4) sudo chvt 4 ## chvt will hang here.
+ 
+ 5) From a 2nd terminal, run :
+  5.1) cat /proc/$(pidof chvt)/stack
+ 
+ [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
+ [<0>] vt_waitactive+0x80/0xd0
+ [<0>] vt_ioctl+0xd26/0x1140
+ [<0>] tty_ioctl+0xf6/0x8c0
+ [<0>] do_vfs_ioctl+0xa8/0x630
+ [<0>] SyS_ioctl+0x79/0x90
+ [<0>] do_syscall_64+0x73/0x130
+ [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
+ [<0>] 0x
+ 
+ It's basically waiting for the VT to be activated, but it never happens.
+ 
+ [Potential regression]
+ 
+ [Other information]
+ 
+ [Original Description]
  sudo strace chvt 4
  execve("/bin/chvt", ["chvt", "4"], 0x7ffd63e5c758 /* 17 vars */) = 0
  brk(NULL) = 0x561e1843
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=74655, ...}) = 0
  mmap(NULL, 74655, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5059e7d000
  close(3) = 0
  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
  read(3, 
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\34\2\0\0\0\0\0"..., 832) = 
832
  fstat(3, {st_mode=S_IFREG|0755, st_size=2030544, ...}) = 0
  mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f5059e7b000
  mmap(NULL, 4131552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f5059878000
  mprotect(0x7f5059a5f000, 2097152, PROT_NONE) = 0
  mmap(0x7f5059c5f000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f5059c5f000
  mmap(0x7f5059c65000, 15072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5059c65000
  close(3) = 0
  arch_prctl(ARCH_SET_FS, 0x7f5059e7c500) = 0
  mprotect(0x7f5059c5f000, 16384, PROT_READ) = 0
  mprotect(0x561e17e87000, 4096, PROT_READ) = 0
  mprotect(0x7f5059e9, 4096, PROT_READ) = 0
  munmap(0x7f5059e7d000, 74655) = 0
  brk(NULL) = 0x561e1843
  brk(0x561e18451000) = 0x561e18451000
  openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
  fstat(3, {st_mode=S_IFREG|0644, st_size=10281936, ...}) = 0
  mmap(NULL, 10281936, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5058ea9000
  close(3) = 0
  openat(AT_FDCWD, "/proc/self/fd/0", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device)
  close(3) = 0
  openat(AT_FDCWD, "/dev/tty", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device)
  close(3) = 0
  openat(AT_FDCWD, "/dev/tty0", O_RDWR) = 3
  ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = 0
  ioctl(3, VT_ACTIVATE, 0x4) = 0
  ioctl(3, VT_WAITACTIVE, 0x4
  
  VT_ACTIVATE will cause a switch to VT number.
  VT_WAITACTIVE will sleep/wait until the specified VT has been activated.
  
  $ sudo cat /proc/$(pidof chvt)/stack
  [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90
  [<0>] vt_waitactive+0x80/0xd0
  [<0>] vt_ioctl+0xd26/0x1140
  [<0>] tty_ioctl+0xf6/0x8c0
  [<0>] do_vfs_ioctl+0xa8/0x630
  [<0>] SyS_ioctl+0x79/0x90
  [<0>] do_syscall_64+0x73/0x130
  [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
  [<0>] 0x
  
  Enable debuglogs doesn't provide additional details.
  
  As soon as auto-login is turned off, chvt is back to normal.
  
  The above has been reproduced on Ubuntu:
  - Ubuntu Bionic w/ gdm3 3.28.3 & kbd 2.0.4
  - Ubuntu disco w/ gdm3 3.30.1 & kbd 2.0.4

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-03-04 Thread Eric Desrochers
** Changed in: gdm3 (Ubuntu Bionic)
   Status: New => In Progress

** Changed in: gdm3 (Ubuntu Bionic)
 Assignee: (unassigned) => Eric Desrochers (slashd)

** Changed in: gdm3 (Ubuntu Bionic)
   Importance: Undecided => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-02-26 Thread Eric Desrochers
** Also affects: linux (Ubuntu)
   Importance: Undecided
   Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-02-26 Thread Eric Desrochers
$ cat /proc/5222/stack
[<0>] __vt_event_wait.isra.3.part.4+0x40/0x90
[<0>] vt_waitactive+0x80/0xd0
[<0>] vt_ioctl+0xd34/0x1150
[<0>] tty_ioctl+0xf6/0x8c0
[<0>] do_vfs_ioctl+0xa8/0x630
[<0>] ksys_ioctl+0x75/0x80
[<0>] __x64_sys_ioctl+0x1a/0x20
[<0>] do_syscall_64+0x5a/0x120
[<0>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[<0>] 0x


# drivers/tty/vt/vt_ioctl.c 
/** 
* vt_waitactive - active console wait 
* @event: event code 
* @n: new console 
* 
* Helper for event waits. Used to implement the legacy 
* event waiting ioctls in terms of events 
*/ 

int vt_waitactive(int n) 
{ 
struct vt_event_wait vw; 
do { 
vw.event.event = VT_EVENT_SWITCH; 
__vt_event_queue(); 
if (n == fg_console + 1) { 
__vt_event_dequeue(); 
break; 
} 
__vt_event_wait(); 
__vt_event_dequeue(); 
if (vw.done == 0) 
return -EINTR; 
} while (vw.event.newev != n); 
return 0; 
} 

# drivers/tty/vt/vt_ioctl.c 
static void __vt_event_wait(struct vt_event_wait *vw) 
{ 
/* Wait for it to pass */ 
wait_event_interruptible(vt_event_waitqueue, vw->done); 
} 


# include/linux/wait.h 
/** 
* wait_event_interruptible - sleep until a condition gets true 
* @wq_head: the waitqueue to wait on 
* @condition: a C expression for the event to wait for 
* 
* The process is put to sleep (TASK_INTERRUPTIBLE) until the 
* @condition evaluates to true or a signal is received. 
* The @condition is checked each time the waitqueue @wq_head is woken up. 
* 
* wake_up() has to be called after changing any variable that could 
* change the result of the wait condition. 
* 
* The function will return -ERESTARTSYS if it was interrupted by a 
* signal and 0 if @condition evaluated to true.

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-02-26 Thread Eric Desrochers
# gdb attach 

(gdb) bt F
#0  0x7fd01e9c65d7 in ioctl () at ../sysdeps/unix/syscall-template.S:78
No locals.
#1  0x55fbea90bce1 in main (argc=2, argv=) at chvt.c:45
fd = 3
num = 

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-02-26 Thread Eric Desrochers
https://gitlab.gnome.org/GNOME/gdm/issues/466

** Description changed:

- sudo strace chvt 4 
- execve("/bin/chvt", ["chvt", "4"], 0x7ffd63e5c758 /* 17 vars */) = 0 
- brk(NULL) = 0x561e1843 
- access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) 
- access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) 
- openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 
- fstat(3, {st_mode=S_IFREG|0644, st_size=74655, ...}) = 0 
- mmap(NULL, 74655, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5059e7d000 
- close(3) = 0 
- access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) 
- openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 
- read(3, 
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\34\2\0\0\0\0\0"..., 832) = 
832 
- fstat(3, {st_mode=S_IFREG|0755, st_size=2030544, ...}) = 0 
- mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f5059e7b000 
- mmap(NULL, 4131552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f5059878000 
- mprotect(0x7f5059a5f000, 2097152, PROT_NONE) = 0 
- mmap(0x7f5059c5f000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f5059c5f000 
- mmap(0x7f5059c65000, 15072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5059c65000 
- close(3) = 0 
- arch_prctl(ARCH_SET_FS, 0x7f5059e7c500) = 0 
- mprotect(0x7f5059c5f000, 16384, PROT_READ) = 0 
- mprotect(0x561e17e87000, 4096, PROT_READ) = 0 
- mprotect(0x7f5059e9, 4096, PROT_READ) = 0 
- munmap(0x7f5059e7d000, 74655) = 0 
- brk(NULL) = 0x561e1843 
- brk(0x561e18451000) = 0x561e18451000 
- openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 
- fstat(3, {st_mode=S_IFREG|0644, st_size=10281936, ...}) = 0 
- mmap(NULL, 10281936, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5058ea9000 
- close(3) = 0 
- openat(AT_FDCWD, "/proc/self/fd/0", O_RDWR) = 3 
- ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0 
- ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device) 
- close(3) = 0 
- openat(AT_FDCWD, "/dev/tty", O_RDWR) = 3 
- ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0 
- ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device) 
- close(3) = 0 
- openat(AT_FDCWD, "/dev/tty0", O_RDWR) = 3 
- ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0 
- ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = 0 
- ioctl(3, VT_ACTIVATE, 0x4) = 0 
- ioctl(3, VT_WAITACTIVE, 0x4 
- 
+ sudo strace chvt 4
+ execve("/bin/chvt", ["chvt", "4"], 0x7ffd63e5c758 /* 17 vars */) = 0
+ brk(NULL) = 0x561e1843
+ access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
+ access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
+ openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
+ fstat(3, {st_mode=S_IFREG|0644, st_size=74655, ...}) = 0
+ mmap(NULL, 74655, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5059e7d000
+ close(3) = 0
+ access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
+ openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
+ read(3, 
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\34\2\0\0\0\0\0"..., 832) = 
832
+ fstat(3, {st_mode=S_IFREG|0755, st_size=2030544, ...}) = 0
+ mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f5059e7b000
+ mmap(NULL, 4131552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f5059878000
+ mprotect(0x7f5059a5f000, 2097152, PROT_NONE) = 0
+ mmap(0x7f5059c5f000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f5059c5f000
+ mmap(0x7f5059c65000, 15072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5059c65000
+ close(3) = 0
+ arch_prctl(ARCH_SET_FS, 0x7f5059e7c500) = 0
+ mprotect(0x7f5059c5f000, 16384, PROT_READ) = 0
+ mprotect(0x561e17e87000, 4096, PROT_READ) = 0
+ mprotect(0x7f5059e9, 4096, PROT_READ) = 0
+ munmap(0x7f5059e7d000, 74655) = 0
+ brk(NULL) = 0x561e1843
+ brk(0x561e18451000) = 0x561e18451000
+ openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
+ fstat(3, {st_mode=S_IFREG|0644, st_size=10281936, ...}) = 0
+ mmap(NULL, 10281936, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5058ea9000
+ close(3) = 0
+ openat(AT_FDCWD, "/proc/self/fd/0", O_RDWR) = 3
+ ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
+ ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device)
+ close(3) = 0
+ openat(AT_FDCWD, "/dev/tty", O_RDWR) = 3
+ ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
+ ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = -1 ENOTTY (Inappropriate ioctl for 
device)
+ close(3) = 0
+ openat(AT_FDCWD, "/dev/tty0", O_RDWR) = 3
+ ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
+ ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = 0
+ ioctl(3, VT_ACTIVATE, 0x4) = 0
+ ioctl(3, VT_WAITACTIVE, 0x4
  
  VT_ACTIVATE will cause a switch to VT 

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-02-26 Thread Iain Lane
Hmm, no idea right now.

Try turning on debugging in /etc/gdm3/custom.conf and see if anything is
outputted in the journal when you try this.

If this happens in disco, an upstream bug would be good too if you don't
mind. Cheers!

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

[Bug 1817738] Re: Can't change virtual terminal when auto-login is enabled

2019-02-26 Thread Eric Desrochers
** Tags added: rls-bb-incoming

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gdm3 in Ubuntu.
https://bugs.launchpad.net/bugs/1817738

Title:
  Can't change virtual terminal when auto-login is enabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1817738/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs