bug#48565: Using move->fdes to move stdin to 9 + interrupt (C-c) exits guile

Maxime Devos <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
user@hostname ~$ guile
GNU Guile 3.0.5
Copyright (C) 1995-2021 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> blabla [C-c C-c]
While reading expression:
User interrupt
scheme@(guile-user)> (move->fdes (fdes->inport 0) 9)
$1 = #<input: file /dev/pts/8>
scheme@(guile-user)> [C-c C-C]
user@hostname ~$

What I expected:
While reading expression:
User interrupt

Your file descriptor may vary.

My suspicion: look at libguile/scmsigs.c (start_signal_delivery_thread),
in particular:

  if (pipe2 (signal_pipe, O_CLOEXEC) != 0)
    scm_syserror (NULL);

signal_pipe[0] and signal_pipe[1] don't seem to be added to the
port table, so primitive-move->fdes does not know about the signal pipes
and will silently overwrite them.

Greetings,
Maxime
signature.asc (application/pgp-signature, 260 B)
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYKeuwBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7tXxAP9achgX7WSfWu/SJ6Z6skw3Ov2Y
awmTcq3HH7gEBY3QHgD+I72oercRzy5MHTueDZ8uTlhez9MjWxMVNHw75TpGyQI=
=+d2m
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.