[Bug 651] SCO 3.2v4.2 and OpenSSH 3.7.1p1 --> connection hangs and does not close (ssh2 only)
bugzilla-daemon at mindrot.org
bugzilla-daemon at mindrot.org
Wed Oct 1 22:00:35 EST 2003
http://bugzilla.mindrot.org/show_bug.cgi?id=651
------- Additional Comments From vikashb at comparexafrica.co.za 2003-10-01 22:00 -------
After spending some more time with this, I have discovered that
gdb always hangs at ret = select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp);
even on 3.5p1.
After some more tracing, it seems that the connection_closed does not change,
the only place that could possiblity change connection_closed is process_input()
in serverloop.c
I am not sure how this section works, attached is a diff that forces
connection_closed to be set to 1 if SIGCHLD is received:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--- serverloop.c.orig Wed Oct 1 09:04:00 2003
+++ serverloop.c Wed Oct 1 13:58:24 2003
@@ -82,6 +82,7 @@
static int connection_closed = 0; /* Connection to client closed. */
static u_int buffer_high; /* "Soft" max buffer size. */
static int client_alive_timeouts = 0;
+int kill_session = 0;
/*
* This SIGCHLD kludge is used to detect when the child exits. The server
@@ -144,6 +145,7 @@
int save_errno = errno;
debug("Received SIGCHLD.");
child_terminated = 1;
+ kill_session = 1;
#ifndef _UNICOS
mysignal(SIGCHLD, sigchld_handler);
#endif
@@ -345,6 +347,11 @@
{
int len;
char buf[16384];
+
+ /* set connection_closed to 1 if received SIGCHLD */
+ if ( kill_session == 1 ) {
+ connection_closed = 1;
+ }
/* Read and buffer any input data from the client. */
if (FD_ISSET(connection_in, readset)) {
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Is this approach incorrect ?
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the openssh-bugs
mailing list