unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23194: Benign error in installation image: "stty: standard input: Input/output error"
@ 2016-04-02 21:09 Chris Marusich
  2016-04-03  6:27 ` Efraim Flashner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chris Marusich @ 2016-04-02 21:09 UTC (permalink / raw)
  To: 23194

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

Hi,

In the installation image for GuixSD v0.10.0, I get some I/O errors on
the terminal just before/during/after the MOTD is displayed:

"stty: standard input: Input/output error"

The error appears to be benign because I encountered no actual problems
with input or output.  However, it would be nice to find out why this is
being emitted and fix it, so that errors are not the first thing that
new GuixSD users see when installing the system.

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23194: Benign error in installation image: "stty: standard input: Input/output error"
  2016-04-02 21:09 bug#23194: Benign error in installation image: "stty: standard input: Input/output error" Chris Marusich
@ 2016-04-03  6:27 ` Efraim Flashner
  2016-04-03  6:52   ` Chris Marusich
  2016-04-04 14:50 ` Ludovic Courtès
  2016-04-04 15:10 ` Ludovic Courtès
  2 siblings, 1 reply; 6+ messages in thread
From: Efraim Flashner @ 2016-04-03  6:27 UTC (permalink / raw)
  To: Chris Marusich; +Cc: 23194

[-- Attachment #1: Type: text/plain, Size: 946 bytes --]

On Sat, 02 Apr 2016 14:09:51 -0700
Chris Marusich <cmmarusich@gmail.com> wrote:

> Hi,
> 
> In the installation image for GuixSD v0.10.0, I get some I/O errors on
> the terminal just before/during/after the MOTD is displayed:
> 
> "stty: standard input: Input/output error"
> 
> The error appears to be benign because I encountered no actual problems
> with input or output.  However, it would be nice to find out why this is
> being emitted and fix it, so that errors are not the first thing that
> new GuixSD users see when installing the system.
> 

I just did the install too and I noticed these also. tty1 is the install
commandline, tty2 is the instructions, and the others aren't set so they give
an error.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23194: Benign error in installation image: "stty: standard input: Input/output error"
  2016-04-03  6:27 ` Efraim Flashner
@ 2016-04-03  6:52   ` Chris Marusich
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Marusich @ 2016-04-03  6:52 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: 23194

[-- Attachment #1: Type: text/plain, Size: 371 bytes --]

Efraim Flashner <efraim@flashner.co.il> writes:

> I just did the install too and I noticed these also. tty1 is the install
> commandline, tty2 is the instructions, and the others aren't set so they give
> an error.

I don't quite understand.  The other ttys have login prompts, right?
They don't seem broken to me.  Why should they cause an error?

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23194: Benign error in installation image: "stty: standard input: Input/output error"
  2016-04-02 21:09 bug#23194: Benign error in installation image: "stty: standard input: Input/output error" Chris Marusich
  2016-04-03  6:27 ` Efraim Flashner
@ 2016-04-04 14:50 ` Ludovic Courtès
  2017-12-07  9:18   ` Ludovic Courtès
  2016-04-04 15:10 ` Ludovic Courtès
  2 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2016-04-04 14:50 UTC (permalink / raw)
  To: Chris Marusich; +Cc: 23194

Chris Marusich <cmmarusich@gmail.com> skribis:

> In the installation image for GuixSD v0.10.0, I get some I/O errors on
> the terminal just before/during/after the MOTD is displayed:
>
> "stty: standard input: Input/output error"

These appear to come from the ‘unicode_start’ command, run by the
‘console-font’ services.  ‘unicode_start’ is a shell script in the ‘kbd’
package that does:

  stty iutf8

In a ‘guix system vm gnu/system/install.scm’ VM in current master, I
sometimes get a different message:

  unicode_start skipped on not a tty

The “not a tty” string comes from the ‘tty’ command (Coreutils).  We get
it when:

  ttyname (STDIN_FILENO);

returns NULL; this can happen if ‘tcgetattr’ returns NULL (see ttyname.c
in libc.)

The ‘stty’ error you mention also happens when ‘tcgetattr’ fails and
returns EIO (stty.c in Coreutils):

--8<---------------cut here---------------start------------->8---
    device_name = _("standard input");

  if (tcgetattr (STDIN_FILENO, &mode))
    error (EXIT_FAILURE, errno, "%s", device_name);
--8<---------------cut here---------------end--------------->8---

‘tcgetattr’ is actually an alias for the TCGETS ioctl.  Looking at the
kernel, I don’t see under what circumstances we can get EIO.

That’s all I have for now!

Thanks for your report.
Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23194: Benign error in installation image: "stty: standard input: Input/output error"
  2016-04-02 21:09 bug#23194: Benign error in installation image: "stty: standard input: Input/output error" Chris Marusich
  2016-04-03  6:27 ` Efraim Flashner
  2016-04-04 14:50 ` Ludovic Courtès
@ 2016-04-04 15:10 ` Ludovic Courtès
  2 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2016-04-04 15:10 UTC (permalink / raw)
  To: Chris Marusich; +Cc: 23194

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]

Chris Marusich <cmmarusich@gmail.com> skribis:

> In the installation image for GuixSD v0.10.0, I get some I/O errors on
> the terminal just before/during/after the MOTD is displayed:
>
> "stty: standard input: Input/output error"

With a patch like this, the issue vanishes:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 394 bytes --]

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index b168543..aa34aa8 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -482,6 +482,7 @@ strings or string-valued gexps."
       (let ((pid (primitive-fork)))
         (case pid
           ((0)
+           (sleep 1)
            (close-fdes 0)
            (dup2 (open-fdes #$tty O_RDONLY) 0)
            (close-fdes 1)

[-- Attachment #3: Type: text/plain, Size: 562 bytes --]


This hints at a race condition.

I *think* that the problem is that at the time the ‘console-font-X’
service starts and invokes ‘unicode_start’, it may be that mingetty
hasn’t opened the tty yet.

Indeed, the ‘term-ttyX’ services are considered started as soon as
mingetty is running, but there’s a chance that it’s running and has not
opened the tty yet.

I think we should use another implementation that doesn’t have this
problem (agetty?).  Given that mingetty.c is 400 lines, we might as well
do it in Scheme.

Ludo’.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#23194: Benign error in installation image: "stty: standard input: Input/output error"
  2016-04-04 14:50 ` Ludovic Courtès
@ 2017-12-07  9:18   ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2017-12-07  9:18 UTC (permalink / raw)
  To: Chris Marusich; +Cc: 23194-done

Hi Chris,

ludo@gnu.org (Ludovic Courtès) skribis:

> Chris Marusich <cmmarusich@gmail.com> skribis:
>
>> In the installation image for GuixSD v0.10.0, I get some I/O errors on
>> the terminal just before/during/after the MOTD is displayed:
>>
>> "stty: standard input: Input/output error"
>
> These appear to come from the ‘unicode_start’ command, run by the
> ‘console-font’ services.  ‘unicode_start’ is a shell script in the ‘kbd’
> package that does:
>
>   stty iutf8
>
> In a ‘guix system vm gnu/system/install.scm’ VM in current master, I
> sometimes get a different message:
>
>   unicode_start skipped on not a tty
>
> The “not a tty” string comes from the ‘tty’ command (Coreutils).  We get
> it when:
>
>   ttyname (STDIN_FILENO);
>
> returns NULL; this can happen if ‘tcgetattr’ returns NULL (see ttyname.c
> in libc.)

I’m happy to say that this is fixed in the 0.14.0 installation image:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?h=version-0.14.0&id=787e8a80d54d8bd5320d76276dc5f4bafe5b86c0

We now use our ‘tcsetattr’ bindings directly instead of invoking
‘unicode_start’.  Additionally, we wait until the TTY really exists
(i.e., mingetty has become its session leader) by checking the return
value of ‘ttyname’.

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-07  9:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-02 21:09 bug#23194: Benign error in installation image: "stty: standard input: Input/output error" Chris Marusich
2016-04-03  6:27 ` Efraim Flashner
2016-04-03  6:52   ` Chris Marusich
2016-04-04 14:50 ` Ludovic Courtès
2017-12-07  9:18   ` Ludovic Courtès
2016-04-04 15:10 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).