This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH] Possibly correct fix to strace phantom process entry
- From: Daniel Santos <daniel dot santos at pobox dot com>
- To: cygwin-patches at cygwin dot com
- Cc: Daniel Santos <daniel dot santos at pobox dot com>
- Date: Mon, 24 Apr 2017 04:37:54 -0500
- Subject: [PATCH] Possibly correct fix to strace phantom process entry
- Authentication-results: sourceware.org; auth=none
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