]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: make sure exec'ed process exists early in process list
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 19 May 2022 08:46:33 +0000 (10:46 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 19 May 2022 08:46:41 +0000 (10:46 +0200)
commit1b86dd7d8c193bca46f08c8f900ae9678c8331d5
tree38289f129804505c34b1b89764519f846e5f6479
parent1559f7f4581832f05339b950fc7c82a8c98a9e0f
Cygwin: make sure exec'ed process exists early in process list

killpg(pgid, 0) (or kill_pgrp(pgid, si_signo=0), in signal.cc)
fails (returns -1) even when there is a process in the process
group pgid, if the process is in the middle of spawnve(), see

  https://cygwin.com/pipermail/cygwin/2022-May/251479.html

When exec'ing a process the assumption is that the exec'ed process creates its
own symlink (in pinfo::thisproc() in pinfo.cc). If the exec'ing process
calls NtClose on it's own winpid symlink, but the exec'ed process didn't
progress enough into initialization, there's a slim chance that neither
the exec'ing process, nor the exec'ed process has a winpid symlink
attached.

Always create the winpid symlink in spawn.cc, even for exec'ed Cygwin
processes.  Make sure to dup the handle into the new process, and stop
creating the winpid symlink in exec'ed processes.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/pinfo.cc
winsup/cygwin/release/3.3.6
winsup/cygwin/spawn.cc
This page took 0.030501 seconds and 5 git commands to generate.