simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sun May 3 11:12:49 BST 2020


TL;DR:
  7ffa6ed4 pty_backend_create: set up SIGCHLD handler earlier.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2020-05-03 11:12:49

commit 7ffa6ed41eaa1e8b347f2b930838a441e168a498
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=7ffa6ed41eaa1e8b347f2b930838a441e168a498;hp=406841668309ec7fabd7aaf0094fe7e9efc1f0cf
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat May 2 16:11:19 2020 +0100

    pty_backend_create: set up SIGCHLD handler earlier.
    
    Mark Wooding points out that when running with the +ut flag, we close
    pty_utmp_helper_pipe during pty backend setup, which causes the
    previously forked helper process to terminate. If that termination
    happens quickly enough, then the code later in pty_backend_create
    won't have set up the SIGCHLD handler and its pipe yet, so when we get
    to the main event loop, we'll fail to notice that subprocess waiting
    to be reaped, and leave it lying around as a zombie.
    
    An easy fix is to move the handler and pipe setup to before the code
    that potentially closes pty_utmp_helper_pipe, so that there isn't a
    race condition any more.

 unix/uxpty.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)



More information about the tartarus-commits mailing list