This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin/cygwin-acl] Fix crash at process init on 64 bit XP/2003 under WOW64


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=a4b5db73c6d31c9c27aa6a69b646367cc4c48c30

commit a4b5db73c6d31c9c27aa6a69b646367cc4c48c30
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Thu Nov 12 11:48:30 2015 +0100

    Fix crash at process init on 64 bit XP/2003 under WOW64
    
    	* init.cc (munge_threadfunc): Don't call NtQueryInformationThread with
    	ThreadQuerySetWin32StartAddress info class on XP 64 and Server 2003 64.
    	It crashes.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/ChangeLog     |  6 ++++++
 winsup/cygwin/init.cc       |  9 ++++++---
 winsup/cygwin/release/2.3.1 | 14 ++++++++++++++
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 2f12f32..7876e2c 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2015-11-12  Corinna Vinschen  <corinna@vinschen.de>
+
+	* init.cc (munge_threadfunc): Don't call NtQueryInformationThread with
+	ThreadQuerySetWin32StartAddress info class on XP 64 and Server 2003 64.
+	It crashes.
+
 2015-11-10  Corinna Vinschen  <corinna@vinschen.de>
 
 	* sec_acl.cc (get_posix_access): Skip merging permissions if current
diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc
index 69e66a0..c6f0e3d 100644
--- a/winsup/cygwin/init.cc
+++ b/winsup/cygwin/init.cc
@@ -57,9 +57,12 @@ munge_threadfunc ()
     {
       char *threadfunc = NULL;
 
-      NtQueryInformationThread (NtCurrentThread (),
-				ThreadQuerySetWin32StartAddress,
-				&threadfunc, sizeof threadfunc, NULL);
+      if (wincap.wow64_has_secondary_stack ())
+	threadfunc = ebp[threadfunc_ix[0]];
+      else
+	NtQueryInformationThread (NtCurrentThread (),
+				  ThreadQuerySetWin32StartAddress,
+				  &threadfunc, sizeof threadfunc, NULL);
       if (!search_for || threadfunc == search_for)
 	{
 	  search_for = NULL;
diff --git a/winsup/cygwin/release/2.3.1 b/winsup/cygwin/release/2.3.1
new file mode 100644
index 0000000..5299d23
--- /dev/null
+++ b/winsup/cygwin/release/2.3.1
@@ -0,0 +1,14 @@
+What's new:
+-----------
+
+
+What changed:
+-------------
+
+
+Bug Fixes
+---------
+
+- The fix for wine introduced in 2.3.0 crashes in 32 bit Cygwin on 64 bit XP
+  and 64 bit Server 2003 only.   This should work now.
+  Addresses: https://cygwin.com/ml/cygwin/2015-11/msg00187.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]