[PATCH] Possibly correct fix to strace phantom process entry

Daniel Santos daniel.santos@pobox.com
Mon Apr 24 23:55:00 GMT 2017


On 04/24/2017 10:38 AM, Corinna Vinschen wrote:

> I'm going with my patch for now.  Mainly because I added some debug
> output to see if we need the Sleep loop at all.  Right now I don't see
> any situation which would qualify for this.
>
>
> Thanks,
> Corinna

Thanks for your help on this Corinna!

I'm inclined to agree about the sleep loop.  I have concerns about 
leaving these odd "ghost" process entries in and I have concerns about 
whacking them for all dynamic loads of cygwin1.dll. :)  The only cleaner 
solution that I can think of us to set an environment variable (or value 
in CYGWIN) to tell cygwin1.dll not to call pinfo::thisproc() in 
child_info_spawn::handle_spawn() -- that still feels like a bandaid.  (I 
suppose there's also using LoadLibraryEx and if there's some parameter 
we can pass to the DLL from there.)

Incidentally, when I debug strace with gdb the problem does away. Thus, 
I've been debugging this by littering the code with 
OutputDebugStringA()s, sometimes adding some Sleep delays, recompiling, 
exiting, restarting sshd, etc.  Is there an easier way to debug stuff 
like this?

Either way, I want to better understand how all of the cases of how 
cygwin1.dll is loaded and processes are inited.  Searching the code, I 
see that cygcheck also uses LoadLibrary, as well as 
cygwin::connector::connector (const char *dll) (although I can't tell 
what that is for).

I have to run, so I'll get back to this later.

Thanks!
Daniel



More information about the Cygwin-patches mailing list