16 Feb 2012 13:46
Cygwin's spawn/exec, mintty and the "Program Compatibility Assistant"
Hi guys, and especially
Hi Andy,
A couple of weeks ago we noticed this strange problem with mintty. The
"Program Compatibility Assistant" (PCA) on W7 took it under its wings
for no apparent reason, and if the session was long enough you would
notice that a specific svchost process, the one running the Pcasvc
service, would take more and more memory and CPU time.
The solution for this problem was either to ask the user to switch off
the PCA service, or a change in Cygwin's spawn/exec code. in short, PCA
sets up a Job for a controlled application, but allows to breakaway from
the job. That's what Cygwin now does in *every* invocation of
spawn/exec:
JOBOBJECT_BASIC_LIMIT_INFORMATION jobinfo;
if (QueryInformationJobObject (NULL, JobObjectBasicLimitInformation,
&jobinfo, sizeof jobinfo, NULL)
&& (jobinfo.LimitFlags & (JOB_OBJECT_LIMIT_BREAKAWAY_OK
| JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK)))
{
/* Add CREATE_BREAKAWAY_FROM_JOB to the CreateProcess flags. */
c_flags |= CREATE_BREAKAWAY_FROM_JOB;
}
While this works, what bugs me is that this additional system call takes
extra time and we all know that Cygwin is slow. Ask the users.
I have still no idea why mintty is affected. It doesn't show up in the
registry-based PCA database. Yesterday I found this on MSDN:
(Continue reading)
RSS Feed