On 16 Jan 1997 07:25:44 GMT, Takis Skagos <ska...@mercury.cs.uregina.ca>
wrote:
>box (RedHat 4.0) to other hosts. Most of the time, when I type
>the CTRL-C key sequence, it locks up the telnet session and I
>usually end up having to CTRL-] and closing it. This is very,
>very annoying.
slirp. Also, it does always not lock-up immediately after pressing
Ctrl-C, I sometimes have to press return a few times to see the
effect. Rlogin over the same ppp/slirp connection does not suffer this
problem. This happens using the telnet program distributed with the
latest NetKit (0.9) as well as the telnet distributed with debian. I
compiled both against libc 5.4.17 and Linux 2.0.27.
strace indicates that telnet does not really lock up (after all, it
responds to Ctrl-]). Characters are still sent to the remote host and
the host will respond accordingly. For example, if I type
`pwd<RETURN>', I see nothing in the window running the locked telnet
but the strace window indicates that the remote host has responded
with my current working directory. The upshot of this is that telnet
is not frozen, it simply refuses to display what it receives from the
remote connection.
One day last week when it locked up (it always does after pressing
Ctrl-C), I noticed the output of the telnet program appearing in
another xterm!!! This indicates that somehow it was writing to a
different pty!
Here is an strace of a telnet session that I just ``locked up'' for
the purpose of this followup. Notice that it is reading from stdin
(fileno=0), writing to stdout (fileno=1), sending data to the remote
using fileno=3, and receiving data using fileno=4. The strace was
started after I logged in to the remote host and before I pressed
Ctrl-C. Lines starting with `#' are my comments:
Script started on Thu Jan 16 12:48:55 1997
[mygir]
[7m[12:48pm] [m /home/john>strace -p 9113
select(4, [0 3], [], [3], NULL) = 1 (in [0])
# It is waiting for input, I press pwd RETURN
read(0, "p", 1009) = 1
select(4, [0 3], [3], [3], {0, 0}) = 1 (out [3], left {0, 0})
send(3, "p", 1, 0) = 1
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [0])
read(0, "w", 1008) = 1
select(4, [0 3], [3], [3], {0, 0}) = 1 (out [3], left {0, 0})
send(3, "w", 1, 0) = 1
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [0])
read(0, "d", 1007) = 1
select(4, [0 3], [3], [3], {0, 0}) = 1 (out [3], left {0, 0})
send(3, "d", 1, 0) = 1
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "p", 745, 0) = 1
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "p", 1) = 1
# The host echos the `p' back and telnet writes it to stdout.
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [0])
read(0, "\r", 1006) = 1
select(4, [0 3], [3], [3], {0, 0}) = 1 (out [3], left {0, 0})
send(3, "\r\0", 2, 0) = 2
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "w", 744, 0) = 1
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "w", 1) = 1
select(4, [0 3], [], [3], {0, 0}) = 1 (in [3], left {0, 0})
recv(3, "d", 743, 0) = 1
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "d", 1) = 1
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "\r\0\r\n", 742, 0) = 4
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "\r\r\n", 3) = 3
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "/nfs/wiwaxia/h1/davis\r\n[aluche"..., 738, 0) = 72
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "/nfs/wiwaxia/h1/davis\r\n[aluche"..., 72) = 72
# The result of pwd has been received by telnet and echoed to stdout.
# So far, so good.
# Now, I press Ctrl-C:
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [0])
read(0, "\3", 1005) = 1
select(4, [0 3], [3], [3], {0, 0}) = 1 (out [3], left {0, 0})
send(3, "\3", 1, 0) = 1
# Ctrl-C received and sent to remote host.
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 2 (in [3]], except [3])
ioctl(1, TCFLSH, TCIFLUSH) = 0
recv(3, "\377", 666, 0) = 1
select(4, [0 3], [], [], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [], NULL) = 1 (in [3])
recv(3, "\362\r\0\r\n\33[K[aluche]\r\n\33"..., 665, 0) = 57
ioctl(1, TCFLSH, TCIFLUSH) = 0
# Host has responded to Ctrl-C and stdout has been flushed.
# Notice that it all is still ok because writes to 1 still take place:
select(4, NULL, NULL, [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "\r\r\n\33[K[aluche]\r\n\33[7m[12"..., 55) = 55
# I press return a few times and then Ctrl-C again until I see the
# ``lockup'':
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [0])
read(0, "\r", 1004) = 1
select(4, [0 3], [3], [3], {0, 0}) = 1 (out [3], left {0, 0})
send(3, "\r\0", 2, 0) = 2
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "\r\0\r\n", 608, 0) = 4
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "\r\r\n", 3) = 3
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "[aluche]\r\n\33[7m[12:49pm]\33[m"..., 604, 0) = 49
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "[aluche]\r\n\33[7m[12:49pm]\33[m"..., 49) = 49
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [0])
read(0, "\r", 1003) = 1
select(4, [0 3], [3], [3], {0, 0}) = 1 (out [3], left {0, 0})
send(3, "\r\0", 2, 0) = 2
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "\r\0\r\n", 555, 0) = 4
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "\r\r\n", 3) = 3
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "[aluche]\r\n\33[7m[12:49pm]\33[m"..., 551, 0) = 49
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "[aluche]\r\n\33[7m[12:49pm]\33[m"..., 49) = 49
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [0])
read(0, "\r", 1002) = 1
select(4, [0 3], [3], [3], {0, 0}) = 1 (out [3], left {0, 0})
send(3, "\r\0", 2, 0) = 2
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "\r\0\r\n", 502, 0) = 4
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "\r\r\n", 3) = 3
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "[aluche]\r\n\33[7m[12:49pm]\33[m"..., 498, 0) = 49
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "[aluche]\r\n\33[7m[12:49pm]\33[m"..., 49) = 49
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [0])
read(0, "\r", 1001) = 1
select(4, [0 3], [3], [3], {0, 0}) = 1 (out [3], left {0, 0})
send(3, "\r\0", 2, 0) = 2
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "\r\0\r\n", 449, 0) = 4
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "\r\r\n", 3) = 3
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "[aluche]\r\n\33[7m[12:49pm]\33[m"..., 445, 0) = 49
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "[aluche]\r\n\33[7m[12:49pm]\33[m"..., 49) = 49
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [0])
read(0, "\r", 1000) = 1
select(4, [0 3], [3], [3], {0, 0}) = 1 (out [3], left {0, 0})
send(3, "\r\0", 2, 0) = 2
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "\r\0\r\n", 396, 0) = 4
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "\r\r\n", 3) = 3
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "[aluche]\r\n\33[7m[12:49pm]\33[m"..., 392, 0) = 49
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "[aluche]\r\n\33[7m[12:49pm]\33[m"..., 49) = 49
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [0])
read(0, "\3", 999) = 1
select(4, [0 3], [3], [3], {0, 0}) = 1 (out [3], left {0, 0})
send(3, "\3", 1, 0) = 1
select(4, [0 3],
...
read more »