[PATCH] Possibly correct fix to strace phantom process entry

Daniel Santos daniel.santos@pobox.com
Mon Apr 24 09:33:00 GMT 2017


The root cause of problem with strace causing long delays when any
process enumerates the process database appears to be calling
myself.thisproc () from child_info_spawn::handle_spawn() when we've
dynamically loaded cygwin1.dll.  It definately fixes the problem, but I
don't konw what other processes dynamically load cygwin1.dll and, thus,
what other side-effects that this may have.  Please verify correctness.

Please see discussion here: https://cygwin.com/ml/cygwin/2017-04/msg00240.html

Daniel

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
---
 winsup/cygwin/dcrt0.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index ea6adcbbd..bbab08725 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -664,7 +664,8 @@ child_info_spawn::handle_spawn ()
   my_wr_proc_pipe = wr_proc_pipe;
   rd_proc_pipe = wr_proc_pipe = NULL;
 
-  myself.thisproc (h);
+  if (!dynamically_loaded)
+    myself.thisproc (h);
   __argc = moreinfo->argc;
   __argv = moreinfo->argv;
   envp = moreinfo->envp;
-- 
2.11.0



More information about the Cygwin-patches mailing list