Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2013-12-10 00:32:24 +0400
committerChristopher Faylor <me@cgf.cx>2013-12-10 00:32:24 +0400
commitae8456bdf2bd8d7a9b3a5ef0b18169caa7548189 (patch)
tree947d4df6505cfa920a119112cefd106df51e8da2 /winsup
parentdb0d50a67d788f0163b7ea2bad17b966f1e43512 (diff)
* globals.cc (hntdll): Define/declare.
* exceptions.cc (inside_kernel): Don't call GetModuleFileName if we know we're in ntdll. * sigproc.cc (wait_sig): Initialize hntdll.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/exceptions.cc3
-rw-r--r--winsup/cygwin/globals.cc1
-rw-r--r--winsup/cygwin/sigproc.cc2
4 files changed, 13 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 90bc5cd3d..d479db262 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2013-12-09 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * globals.cc (hntdll): Define/declare.
+ * exceptions.cc (inside_kernel): Don't call GetModuleFileName if we
+ know we're in ntdll.
+ * sigproc.cc (wait_sig): Initialize hntdll.
+
2013-12-09 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/stdlib.h (initstate, random, setstate, srandom):
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index c0fb0c877..98eb78760 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -394,6 +394,9 @@ _cygtls::inside_kernel (CONTEXT *cx)
# define h ((HMODULE) m.AllocationBase)
if (!h || m.State != MEM_COMMIT) /* Be defensive */
res = true;
+ else if (h == hntdll)
+ res = true; /* Calling GetModuleFilename on ntdll.dll
+ can hang */
else if (h == user_data->hmodule)
res = false;
else if (!GetModuleFileNameW (h, checkdir, windows_system_directory_length + 6))
diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc
index 531703a7a..a004276d7 100644
--- a/winsup/cygwin/globals.cc
+++ b/winsup/cygwin/globals.cc
@@ -23,6 +23,7 @@ HANDLE NO_COPY hProcToken;
HANDLE NO_COPY hProcImpToken;
HANDLE my_wr_proc_pipe;
HMODULE NO_COPY cygwin_hmodule;
+HMODULE NO_COPY hntdll;
int NO_COPY sigExeced;
WCHAR windows_system_directory[MAX_PATH];
UINT windows_system_directory_length;
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index a2a2edd33..906dc6a35 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -1205,6 +1205,8 @@ wait_sig (VOID *)
sigproc_printf ("entering ReadFile loop, my_readsig %p, my_sendsig %p",
my_readsig, my_sendsig);
+ hntdll = GetModuleHandle ("ntdll.dll");
+
for (;;)
{
DWORD nb;