We are seeing this on our systems too, which are using "console=tty0
console=ttyS0" (making the SERIAL console master).

What is happening is that vt-is-UTF8 prints a console detection code to
/dev/tty0 directly, and tries to read the response from there too - but
ends up waiting forever because the terminal does not respond.

Digging deeper, this is because it's calling "get_console_fd", which
tries to open /dev/tty and fails (ENXIO - No such device or address), so
falls back to /dev/tty0 *before* /dev/console.  It then sends its output
to /dev/tty0 - which seems to get mirrored to /dev/ttyS0, presumably
because of the console settings (linux kernel version=2.6.20.4).

In any case, this function is basically broken.  It's supposed to be
returning information for the current VT, but hasn't even established
that the current VT is the console, let alone which console might be
active.  It also doesn't cater for the case where there is no terminal
there at all to respond to its query.

Anyway, ignoring the above brokenness, probably the easiest change that
can be made is to put an alarm in before the fscanf in lib/testUTF8.c.

I'll confirm that this behaves as expected, but please consider this
patch for the next sarge update as well as etch.

--- console-tools/build-tree/console-tools-0.2.3/lib/testUTF8.c.orig
1999-09-01 08:41:05.000000000 +1200
+++ console-tools/build-tree/console-tools-0.2.3/lib/testUTF8.c
2007-04-15 12:07
:25.000000000 +1200
@@ -43,12 +43,15 @@
        * - ask cursor position
        */
       fprintf (f, "\030\032" "\r\357\200\240" "\033[6n\033D");
+      alarm(1);
       /* get cursor position; set error if no answer */
       if (2 != fscanf (f, "\033[%u;%u", &y, &x))
        {
+          alarm(0);
          errno = EIO;
          return -1;
        }
+      alarm(0);
       tcsetattr (fd, TCSANOW, &termios_orig);
       /* go back; erase 1 or 3 char */
       fprintf(f, "\033[1F" "\033[%uX", (x-1));



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to