OpenSSH problem report on Linux 2.2.14.

Ishikawa ishikawa at yk.rim.or.jp
Fri Jan 21 04:05:56 EST 2000


I have been using OpenSSH for a while, and I would like to thank you
for the great package.

Here is a report of mysterious warning message lines, I get while I
use OpenSSH.
They don't seem to be serious, but annoying nevertheless.

version: openssh-1.2.1pre27

OS
 Linux standard 2.2.14 #18 SMP Thu Jan 6 06:07:45 JST 2000 i586 unknown
 (compiled with gcc 2.95.2)

Compiler
 gcc -v
 Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/specs
   gcc version 2.95.2 19991024 (release)

Symptom:

I login into a remote host (remote-host, below)
and use port forwarding to access web servers beyond that machinee
like the following.

/usr/local/bin/ssh -l ishikawa  -C -L3000:hostA:3000 -L3001:hostB:3000
-L3002:hostC:3000 -L3003:hostD:3000 -L3004:localhost:3000
-L8082:u43:8082 -L3026:hostA:23  -L8080:hostB:8080  remote-host

hostB ... I believe this is sunos 4.1.4 sparc host
remote-host ... I believe this is SunOS  5.5.1 or 5.6 sparc host.

After having connected to remote-host using ssh (from openssh
package), I used the port-forwarding to access the web server ports.
"-L8080:hostB:8080" and others are used for this purpose, for example.
Whenever I visit a new page, I noticed that the following
warning lines are printed to the initial
window where ssh established the connection to remote-host and shell
prompt was displayed.

Warning messages shown:
These are just a few examples.
Each time a new connection is made (and cut) for, say,  the
connection to the remote web server via port forwarding,
lines similar to the following were shown.

chan_shutdown_read failed for #8/fd12 [i1 o128]: Transport endpoint is
not connected
chan_shutdown_read failed for #8/fd12 [i1 o128]: Transport endpoint is
not connected
chan_shutdown_read failed for #11/fd15 [i1 o128]: Transport endpoint is
not connected
chan_shutdown_read failed for #10/fd14 [i1 o128]: Transport endpoint is
not connected
chan_shutdown_read failed for #9/fd13 [i1 o128]: Transport endpoint is
not connected
chan_shutdown_read failed for #8/fd12 [i1 o128]: Transport endpoint is
not connected
chan_shutdown_read failed for #13/fd17 [i1 o128]: Transport endpoint is
not connected
chan_shutdown_read failed for #12/fd16 [i1 o128]: Transport endpoint is
not connected
chan_shutdown_read failed for #14/fd18 [i1 o128]: Transport endpoint is
not connected
chan_shutdown_read failed for #9/fd13 [i1 o128]: Transport endpoint is
not connected
chan_shutdown_read failed for #8/fd12 [i1 o128]: Transport endpoint is
not connected


Are they indication of serious problems?
If not, is it safe to shut up ssh so that
these warning lines are not printed?

MY PRELIMINARY ANALYSIS of the PROBLEM.

The message seems to come from the following routine in
nchan.c:

static void
chan_shutdown_read(Channel *c)
{
        debug("channel %d: shutdown_read", c->self);
        if (shutdown(c->sock, SHUT_RD) < 0)
                error("chan_shutdown_read failed for #%d/fd%d [i%d o%d]:
%.100s",
                      c->self, c->sock, c->istate, c->ostate,
strerror(errno));
}

Although the self and sock fields vary,
ostate is 128 and istate is 1 in the warning messages.

========================================
Where does ostate get set?
----------------------------------------

grep ostate *.c *.h

channels.c:     chan_init_iostates(c);
channels.c:                     if (ch->ostate == CHAN_OUTPUT_OPEN ||
channels.c:                         ch->ostate ==
CHAN_OUTPUT_WAIT_DRAIN) {
channels.c:                             } else if (ch->ostate ==
CHAN_OUTPUT_WAIT_DRAIN) {
channels.c:                             debug("X11 rejected %d i%d/o%d",
ch->self, ch->istate, ch->ostate);
channels.c:                             debug("X11 rejected %d i%d/o%d",
ch->self, ch->istate, ch->ostate);
channels.c:     if (!compat13 && ch->ostate != CHAN_OUTPUT_OPEN)
channels.c:                         c->ostate, buffer_len(&c->output));
nchan.c:/* events concerning the OUTPUT from channel for socket (ostate)
*/
nchan.c:        switch (c->ostate) {
nchan.c:                c->ostate = CHAN_OUTPUT_WAIT_DRAIN;
nchan.c:                c->ostate = CHAN_OUTPUT_CLOSED;
nchan.c:                error("protocol error: chan_rcvd_ieof %d for
ostate %d", c->self, c->ostate);
nchan.c:        switch (c->ostate) {
nchan.c:                c->ostate = CHAN_OUTPUT_WAIT_IEOF;
nchan.c:                c->ostate = CHAN_OUTPUT_CLOSED;
nchan.c:                error("internal error: chan_write_failed %d for
ostate %d", c->self, c->ostate);
nchan.c:        switch (c->ostate) {
nchan.c:                c->ostate = CHAN_OUTPUT_CLOSED;
nchan.c:                error("internal error: chan_obuf_empty %d for
ostate %d", c->self, c->ostate);
nchan.c: * ACTIONS: should never update the channel states: c->istate or
c->ostate
nchan.c:        switch (c->ostate) {
nchan.c:                error("internal error: channel %d: cannot send
OCLOSE for ostate %d", c->self, c->istate);
nchan.c:                      c->self, c->sock, c->istate, c->ostate,
strerror(errno));
nchan.c:        if (c->istate == CHAN_INPUT_CLOSED && c->ostate ==
CHAN_OUTPUT_CLOSED) {
nchan.c:chan_init_iostates(Channel *c)
nchan.c:        c->ostate = CHAN_OUTPUT_OPEN;
channels.h:     int     ostate;         /* output to channel  (state of
transmit half) */
nchan.h:void    chan_init_iostates(Channel * c);
========================================

OK, so the value set to ostate must be 128 before the message was
printed.

It turns out CHAN_OUTPUT_CLOSED is the value, 128, we are looking for.

nchan.h:#define CHAN_OUTPUT_CLOSED              0x80


Now what is the state 1 for istate?
It turns out the the following states (in nchan.h)
describe the status.

#define CHAN_INPUT_OPEN                 0x01

So the message was printed when
istate was CHAN_INPUT_OPEN and
ostate was CHAN_OUTPUT_CLOSED.

cf. From nchan.h.
/* possible input states */
#define CHAN_INPUT_OPEN                 0x01
#define CHAN_INPUT_WAIT_DRAIN           0x02
#define CHAN_INPUT_WAIT_OCLOSE          0x04
#define CHAN_INPUT_CLOSED               0x08

/* possible output states */
#define CHAN_OUTPUT_OPEN                0x10
#define CHAN_OUTPUT_WAIT_DRAIN          0x20
#define CHAN_OUTPUT_WAIT_IEOF           0x40
#define CHAN_OUTPUT_CLOSED              0x80


Oh, I forgot.
The remote server runs the sshd from the
original ssh distributions (not sure which version).

I wonder if there is a way to shut up ssh so that
these warning lines won't be printed.

Thank you again for the great free package!

Happy Hacking

Chiaki Ishikawa







More information about the openssh-unix-dev mailing list