Displaying 20 results from an estimated 38 matches for "child_termin".
2001 Oct 25
2
SIGCHLD race *trivial* patch
...is a patch against an older version of OpenSSH with other
stuff anyways, BUT, it's so TRIVIAL(*), that you can see how it would
apply to newer versions (which I've not tried).
Here's the gist: server_loop2() has a race condition with respect to
reception of SIGCHLD and checking/setting child_terminated. This patch
does two things: wait_until_can_do_something() adds a 1 second timeout
to select() IF AND ONLY IF (!channel_still_open) AND, server_loop2()
breaks out of its loop when there are no sessions left.
Blocking SIGCHLD before select()ing would not fix the problem, nor would
that be very...
2001 Sep 18
1
SIGCHLD race condition?
...children of sshd remain (even
as zombies), and it has no other interesting open fds.
If you send a SIGCHLD to the hung sshd, it wakes up and exits.
As far as I can see, there's a race condition in
wait_until_can_do_something(), both in RedHat 2.5.2p2-5 and in the
latest CVS sources. It tests child_terminated, and sets a non-zero
timeout if so, before calling select(). However, there is a very small
window (between checking child_terminated and calling select() in which
a SIGCHLD can arrive and set child_terminated. If this happens, and
there is no other activity from the client or the child fds, ss...
2006 Nov 27
5
[Bug 52] ssh hangs on exit
http://bugzilla.mindrot.org/show_bug.cgi?id=52
dtucker at zip.com.au changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #1075 is|0 |1
obsolete| |
Attachment #1098 is|0 |1
obsolete|
2009 Mar 24
0
Issue with child process exits
...th hangs on exit from ssh and sftp sessions. A
quick look at the OpenSSH source code revealed the following:
In serverloop.c there is a signal handler defined for SIGCHLD as follows:
static void
sigchld_handler(int sig)
{
int save_errno = errno;
debug("Received SIGCHLD.");
child_terminated = 1;
#ifndef _UNICOS
mysignal(SIGCHLD, sigchld_handler);
#endif
notify_parent();
errno = save_errno;
}
As far as I can tell the primary purpose of this method is to set a value
for child_terminated which is referenced by the following method:
static void
collect_children(vo...
2000 Oct 27
1
Typo in 2.2.0p1 ??
I don't already figure out what is the real impact of this but I think there is
a typo in function sigchld_handler() in serverloop.c (l 75).
It is written
if (WIFEXITED(child_wait_status) ||
WIFSIGNALED(child_wait_status))
child_terminated = 1;
child_has_selected = 0;
But I think one actually means:
if (WIFEXITED(child_wait_status) ||
WIFSIGNALED(child_wait_status)) {
child_terminated = 1;
child_has_selected = 0;
}
Regards,
Philippe
2001 Oct 31
2
suggested fix for the sigchld race
...u -r1.82 serverloop.c
--- serverloop.c 10 Oct 2001 22:18:47 -0000 1.82
+++ serverloop.c 11 Oct 2001 18:06:33 -0000
@@ -92,6 +92,45 @@
/* prototypes */
static void server_init_dispatch(void);
+/*
+ * we write to this pipe if a SIGCHLD is caught in order to avoid
+ * the race between select() and child_terminated
+ */
+static int notify_pipe[2];
+static void
+notify_setup(void)
+{
+ if (pipe(notify_pipe) < 0) {
+ error("pipe(notify_pipe) failed %s", strerror(errno));
+ notify_pipe[0] = -1; /* read end */
+ notify_pipe[1] = -1; /* write end */
+ } else {
+ set_nonblock(notify_pipe[0]);
+...
2001 Jan 18
1
sigchld_handler2.
...a diff of what I did (basically just resetting it as it was for
2.3.0p1):
*** serverloop.c.orig Thu Jan 18 08:41:13 EST 2001
--- serverloop.c Wed Jan 17 16:01:41 EST 2001
***************
*** 109,115 ****
int save_errno = errno;
debug("Received SIGCHLD.");
child_terminated = 1;
- signal(SIGCHLD, sigchld_handler2);
errno = save_errno;
}
--- 109,114 ----
***************
*** 667,672 ****
--- 666,672 ----
if (child_terminated) {
while ((pid = waitpid(-1, &status, WNOHANG)) >
0)...
2005 Jan 19
1
sshd hangs
...ren() not
handling ECHILD:
{
pid_t pid;
sigset_t oset, nset;
int status;
/* block SIGCHLD while we check for dead children */
sigemptyset(&nset);
sigaddset(&nset, SIGCHLD);
sigprocmask(SIG_BLOCK, &nset, &oset);
if (child_terminated) {
while ((pid = waitpid(-1, &status, WNOHANG)) > 0 ||
(pid < 0 && errno == EINTR))
if (pid > 0)
session_close_by_pid(pid, status);
child_termi...
2001 Jul 09
1
sshd problem on Solaris 7: Control-C hangs shell
...static int fderr_eof = 0; /* EOF encountered readung from fderr. */
static int fdin_is_tty = 0; /* fdin points to a tty. */
@@ -107,6 +108,9 @@
wait_pid, child_pid);
if (WIFEXITED(child_wait_status) ||
- WIFSIGNALED(child_wait_status))
+ WIFSIGNALED(child_wait_status)) {
child_terminated = 1;
+ if (fdout_maybe_eof)
+ fdout_eof = 1;
+ }
}
signal(SIGCHLD, sigchld_handler);
@@ -338,10 +342,14 @@
/* Read and buffer any available stdout data from the program. */
- if (!fdout_eof && FD_ISSET(fdout, readset)) {
+ if (!fdout_eof && (child_terminated || FD_...
2007 Jan 16
11
[Bug 52] ssh hangs on exit
http://bugzilla.mindrot.org/show_bug.cgi?id=52
dtucker at zip.com.au changed:
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |1274
nThis| |
------- You are receiving this mail because: -------
You are the assignee for
2000 Dec 12
1
reinstalling SIGCHLD handler before wait()
...r2() when exiting a
protocol 2 session apparently because we don't call wait before
reinstalling the handler. Any thoughts on this issue or how to address
it?
serverloop.c from latest snapshots:
void
sigchld_handler2(int sig)
{
int save_errno = errno;
debug("Received SIGCHLD.");
child_terminated = 1;
signal(SIGCHLD, sigchld_handler2);
errno = save_errno;
}
from signal(5) on HP-UX 11 (SIGCLD is the same as SIGCHLD):
If one of the signal interface routines is used to
set the action for SIGCLD to be caught (that is, a...
2005 Jan 24
0
AW: sshd hangs
...ic void
collect_children(void)
{
pid_t pid;
sigset_t oset, nset;
int status;
/* block SIGCHLD while we check for dead children */
sigemptyset(&nset);
sigaddset(&nset, SIGCHLD);
sigprocmask(SIG_BLOCK, &nset, &oset);
if (child_terminated) {
while ((pid = waitpid(-1, &status, WNOHANG)) > 0 ||
(pid < 0 && errno == EINTR))
if (pid > 0)
session_close_by_pid(pid, status);
child_terminated = 0;
}...
2003 Sep 15
1
SCO 3.2v4.2 and OpenSSH -current --> connection hangs and does no t close
...---------------
I have tried my hand at gdb, and this is the output and backtrace
before the session hangs.
(gdb)
wait_until_can_do_something (readsetp=0x7ffff8e4, writesetp=0x7ffff8e0,
maxfdp=0x7ffff8dc, nallocp=0x7ffff8d8, max_time_milliseconds=0)
at serverloop.c:313
313 if (child_terminated &&
packet_not_very_much_data_to_write())
(gdb)
317 if (max_time_milliseconds == 0)
(gdb)
318 tvp = NULL;
(gdb)
326 ret = select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp);
(gdb) p connection_closed
$1 = 0
(gdb) bt
#0 wait_until_can_do_som...
2007 Mar 23
7
4.6p1 chan_read_failed error
The 4.6p1 sshd is logging this error during remote commands or file
transfers:
error: channel 0: chan_read_failed for istate 3
Platform is Solaris 8, 4.6p1 + OpenSSL 0.9.8d.
The commands and transfers work correctly, so the error message appears
to be spurious. The error message does not appear when processing logins.
Otherwise 4.6p1 is running without any apparent problems. This error
2000 May 15
1
AIX authenticate patches
...mp; !defined(DISABLE_LASTLOG) && !defined(WITH_AIXAUTHENTICATE) */
}
/* Records that the user has logged out. */
--- serverloop.c.orig Wed May 10 14:34:00 2000
+++ serverloop.c Thu May 11 08:17:17 2000
@@ -85,7 +85,6 @@
int save_errno = errno;
debug("Received SIGCHLD.");
child_terminated = 1;
- signal(SIGCHLD, sigchld_handler2);
errno = save_errno;
}
@@ -640,6 +639,7 @@
while ((pid = waitpid(-1, &status, WNOHANG)) > 0)
session_close_by_pid(pid, status);
child_terminated = 0;
+ signal(SIGCHLD, sigchld_handler2);
}
channel_after_select(&readse...
2001 Jan 19
1
Core dumps on HP-UX
Hello,
I've been trying to get openssh working at our site recently, but have
been running into these problems. In using the "release" version
(openssh-2.3.0p1) we kept getting these broken pipe errors:
zcat: stdout: Broken pipe
Damien suggested we try out the snapshot versions, so I've been trying
out the daily versions since last week. With the snapshots, the pipe
problem
2001 Oct 10
7
OpenSSH solaris: bad return code after exec of remote command
Hi OpenSSH developers,
I am using openSSH (now 2.9.9p2, but prob occurs in 2.9p2 also) to execute
commands on a remote machine which outputs data to stdout then pipes it to
another invocation of ssh which connects back to the first machine in the same
way, where it starts a program to read and store the output from the command on
the second machine. I am using the "command" option in
2000 Dec 28
2
sshd doesn't log which RSA key was used
Hi guys,
and another feature request for sshd which I would classify as really
useful. And I think this behaviour is currently not available (If yes,
sorry, I must have missed it):
> I believe that the sshd should log which RSA key was used to connect to
> an account. When there are a number of keys in the authorized_keys file
> it is often useful to know which one was used for each
2001 Jul 22
2
Patches for Cray T3Es running Unicossmk and SV1s running Unicos
This patch is against Cray patch against openssh-SNAP-20010710. Here
a few notes about them:
1) rijndael does not work on cray due to the fact it is rooted in 32 bits.
I looking for a fix, it may come form Wendy Palam. For now the cray
default to the following cihpers for ssh version 2 ssh are:
3des-cbc,blowfish-cbc,cast128-cbc,arcfour
2) Crays don't have setitimer so I
2000 Aug 08
0
v2 connection logging vs v1
...len==0 from the read(), and does:
verbose("Connection closed by remote host.");
fatal_cleanup();
Comparing the v1 server_loop and the v2 server_loop2, the v1 loop appears
to have significantly more checks for breaking the loop:
if (((fdout_eof && fderr_eof) ||
(child_terminated && child_has_selected)) &&
!packet_have_data_to_write() &&
(buffer_len(&stdout_buffer) == 0) &&
(buffer_len(&stderr_buffer) == 0)) {
if (!channel_still_open())
break;
as well as other useful logging...