https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c9933e57dab77816b5491c67917d4aac755fa4c6
commit c9933e57dab77816b5491c67917d4aac755fa4c6 Author: Corinna Vinschen <[email protected]> AuthorDate: Thu Jan 22 17:09:00 2026 +0100 Commit: Corinna Vinschen <[email protected]> CommitDate: Thu Jan 22 17:09:29 2026 +0100 Cygwin: spawn/exec: drop breaking away from job Remove breaking away from job during spawn/exec because it's not required anymore for 99% of the processes. This was required back when Cygwin executables didn't have a manifest claiming compatibility with all Windows versions since Vista. These days, only very few executables missing the manifest are left, certainly none in the distro. This frees up job breakaway for potential extensions to setrlimit. Signed-off-by: Corinna Vinschen <[email protected]> Diff: --- winsup/cygwin/spawn.cc | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 7d993d0810eb..1bfc610e14fa 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -410,37 +410,6 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, if (winjitdebug && !real_path.iscygexec ()) c_flags |= CREATE_DEFAULT_ERROR_MODE; - /* We're adding the CREATE_BREAKAWAY_FROM_JOB flag here to workaround - issues with the "Program Compatibility Assistant (PCA) Service". - For some reason, when starting long running sessions from mintty(*), - the affected svchost.exe process takes more and more memory and at one - point takes over the CPU. At this point the machine becomes - unresponsive. The only way to get back to normal is to stop the - entire mintty session, or to stop the PCA service. However, a process - which is controlled by PCA is part of a compatibility job, which - allows child processes to break away from the job. This helps to - avoid this issue. - - First we call IsProcessInJob. It fetches the information whether or - not we're part of a job 20 times faster than QueryInformationJobObject. - - (*) Note that this is not mintty's fault. It has just been observed - with mintty in the first place. See the archives for more info: - http://cygwin.com/ml/cygwin-developers/2012-02/msg00018.html */ - JOBOBJECT_BASIC_LIMIT_INFORMATION jobinfo; - BOOL is_in_job; - - if (IsProcessInJob (GetCurrentProcess (), NULL, &is_in_job) - && is_in_job - && QueryInformationJobObject (NULL, JobObjectBasicLimitInformation, - &jobinfo, sizeof jobinfo, NULL) - && (jobinfo.LimitFlags & (JOB_OBJECT_LIMIT_BREAKAWAY_OK - | JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK))) - { - debug_printf ("Add CREATE_BREAKAWAY_FROM_JOB"); - c_flags |= CREATE_BREAKAWAY_FROM_JOB; - } - if (mode == _P_DETACH) c_flags |= DETACHED_PROCESS; else
