[erlang-questions] ssh application leaks processes(?)

Stefan Grundmann <>
Wed Sep 1 21:31:15 CEST 2010


unfortunately this leads to
a) not so helpful error messages (when ssh_subsystem_sup reaches its restart 
limit and kills itself)
and
b) a (very) small memory leak in ssh_system_sup (the child never gets deleted)

i think the way it should be solved is to add support for stopping a 
ssh_subsystem_sup to ssh_system_sup and call this from 
ssh_connection_manager:terminate/2.


On Wednesday 25 August 2010 21:48:49 Attila Rajmund Nohl wrote:
> I've patched our local installation about a year ago to use
> 'permanent'. It works fine.
> 
> 2010/8/25, Stefan Grundmann <>:
> > Hi,
> > while using the ssh-2.0 application  i encountered the following problem:
> > 
> > The ssh_system_sup  supervisor (created via ssh:daemon/1,2,3) has as
> > children
> > the ssh_acceptor_sup supervisor and for every connected client an
> > ssh_subsystem_sup supervisor. When a client connection  is closed one
> > would expect that all processes in the supervision tree of this
> > connection die - which is not the case: the ssh_subsystem_sup process
> > and one child (ssh_channel_sup) stay alive.
> > 
> > The reason  for this behavior is that the child specs of the
> > ssh_channel_sup and ssh_connection_sup in
> > lib/ssh-2.0/src/ssh_subsystem_sup,erl (line 75 and line 88) define a
> > 'transient' Restart and while  the subtree supervised by
> > ssh_connection_sup as well as the ssh_connection_sup process itself
> > terminates
> > on connection close, the ssh_channel_sup process does not. Which leaves 2
> > processes alive that won't be of any further use.
> > 
> > If the Restart is changed to 'permanent'  the problem goes away.
> > 
> > Since  lib/ssh-2.0/src/ssh_subsystem_sup,erl contains (line 76 and line
> > 89) commented out code that sets Restart to permanent; i would like to
> > know what the reason for a transient Restart might be.
> > 
> > best regards
> > Stefan Grundmann
> > 
> > ________________________________________________________________
> > erlang-questions (at) erlang.org mailing list.
> > See http://www.erlang.org/faq.html
> > To unsubscribe; mailto:


More information about the erlang-questions mailing list