[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ghost 'ssh' and 'cvs server' processes



Please CC me, as I'm not subscribed to the list.

On Mon, 3 Mar 2003, Colin Watson wrote:

> On Mon, Mar 03, 2003 at 07:09:19PM +0100, Cristian Ionescu-Idbohrn wrote:
> > I run cvs with CVS_RSH=ssh.
> >
> > I regulary find hundreds of ghost processes both on the clients and on
> > the cvs server.
>
> Sounds like another manifestation of #164797 to me, perhaps?

Hmm... I wonder...

> > I expect a long list. The process forest looks like this:
> >
> >   johndoe  25078  pts/0  S  |   \_ bash
> >   johndoe  25143  pts/0  S  |       \_ cvs stat -v
> >   johndoe  25145  pts/0  S  |       |   \_ ssh cvs-server-box cvs server
> >   johndoe  25144  pts/0  S  |       \_ less
> >
> > I'm satisfied with what I see on the first page 'less' shows and just
> > quit. I see this message in the xterm window:
> >
> >   cvs [status aborted]: received broken pipe signal
> >
> > Looking att the process forest again, I see the ssh process is alive
> > (25145 above) instead of being dead and lost contact with its parent:
> >
> >   johndoe  25145  pts/0  S  ssh cvs-server-box cvs server
>
> Alternatively, if 'cvs stat' is failing to reap its ssh child process,
> then perhaps that's a bug in cvs.

Looking closer to PID 25143 and 25145 above:

  (25143) cvs stat -v

gets a SIGPIPE and goes away:

  write(1, "5)\n\tR1_0_18     \t(r"..., 4096) = -1 EPIPE (Broken pipe)
  --- SIGPIPE (Broken pipe) @ 0 (0) ---
  write(1, "5)\n\tR1_0_18     \t(r"..., 4096) = -1 EPIPE (Broken pipe)
  write(2, "cvs", 3)                      = 3
  write(2, " ", 1)                        = 1
  write(2, "[", 1)                        = 1
  write(2, "status", 6)                   = 6
  write(2, " aborted]", 9)                = 9
  write(2, ": ", 2)                       = 2
  write(2, "received ", 9)                = 9
  write(2, "broken pipe", 11)             = 11
  write(2, " signal", 7)                  = 7
  write(2, "\n", 1)                       = 1
  munmap(0x40014000, 4096)                = 0
  munmap(0x40016000, 4096)                = 0
  _exit(1)                                = ?

The child ssh process:

  (25145) ssh cvs-server-box cvs server

gets the SIGPIPE too:

  select(9, [4 5], [4 7], NULL, NULL)     = 1 (out [4])
  write(4, "\363"..., 32) = 32
  select(9, [4 5], [7], NULL, NULL)       = 2 (in [5], out [7])
  read(5, "", 16384)                      = 0
  close(5)                                = 0
  write(7, "M ================="..., 131072) = -1 EPIPE (Broken pipe)
  --- SIGPIPE (Broken pipe) @ 0 (0) ---
  close(7)                                = 0
  select(9, [4], [4], NULL, NULL)         = 1 (out [4])
  write(4, "\260"..., 32) = 32
  select(9, [4], [], NULL, NULL)          = 1 (in [4])
  read(4, "\225"..., 8192) = 56

but chooses to stay among us and cause grief :(
Maybe the parent process (cvs) should send SIGTERM to its child (ssh),
or something...
Which one of these two is at error here?


Cheers,
Cristian



Reply to: