#2 blocks forever in Ssh.close() if two or more instances used

open
nobody
None
5
2007-01-24
2007-01-24
No

If you create more than one instances of pyssh,Ssh in the same process, then the process hangs when you close() any of them.

The problem is that each instance registers a signal handler to handle SIGCHLD, so each of them sees the signal, and each of them calls a blocking os.waitpid() on the pid its own SSH process. When the first SIGCHLD arrives, all the instances call a blocking os.waitpid(), even those which do not expect their SSH subprocess to exit.

The solution is to use a nonblocking os.waitpid() call.

Discussion

  • Norbert Buchmüller

    Logged In: YES
    user_id=1700532
    Originator: YES

    File Added: pyssh0.3-sighandler_bug.diff

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks