Thanks, this strace shows that src/getfd.c:getfd_keymap() is unable to
find any VTs not in raw mode:

int
getfd_keymap(void) {
        int fd, bestfd = -1;
        char ttyname[sizeof("/dev/ttyNN")] = "/dev/tty";
        int i;

#define CHECK_FD_KEYMAP do { \
        if (is_a_console(fd)) { \
                long mode = kbmode(fd); \
                if (mode == K_UNICODE) { \
                        if (bestfd != -1) \
                                close(bestfd); \
                        return fd; \
                } else if (mode == K_XLATE && bestfd == -1) \
                        bestfd = fd; \
                else \
                        close(fd); \
        } else \
                close(fd); \
} while (0)

[...]

        for (i = 1; i <= 12; ++i) {
                snprintf(ttyname + sizeof("/dev/tty") - 1, 3, "%d", i);
                if ((fd = open_a_console(ttyname)) >= 0)
                        CHECK_FD_KEYMAP;
        }

        fprintf(stderr,
                _("Couldn't get a file descriptor referring to the console\n"));

        /* total failure */
        exit(1);
}

is_a_console() checks KDGKBTYPE, kbmode() checks KDGKBMODE.

Could you please compile and run the attached program as root on the
affected system, and post the results?

In the course of investigating, I've discovered locally that ioctl(fd,
KDGKBMODE), despite taking an unsigned long * as an argument, doesn't
fully clear the address here on xenial x86_64.  So if this program
returns sensible results on your system, we may be looking at a memory
initialization bug.

** Attachment added: "check-kbd-mode.c"
   
https://bugs.launchpad.net/ubuntu/+source/console-setup/+bug/1621824/+attachment/4744461/+files/check-kbd-mode.c

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

Title:
  MFG:Garrison - Ubuntu 16.04.1 dmesg error "systemd[1]: Failed to start
  Set console keymap."

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/console-setup/+bug/1621824/+subscriptions

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

Reply via email to