Protection problem in Windows 2003 Server

Ha, Jungwoo jungwoo.ha at intel.com
Mon Jun 30 17:02:15 PDT 2008


Hi,

I found that on Windows 2003 Server, access violation happens when interpreter calls to JIT-ed code.
After changing the protection bit to PAGE_EXECUTE_READWRITE at GCHeap::CommitMemory, it works fine.
However, this problem didn't happen on Windows XP.
Is this a right place to fix? Any comments?

---- (patch) ----
$ hg diff
diff -r 5f42458d073e space/MMgc/GCHeapWin.cpp
--- a/space/MMgc/GCHeapWin.cpp  Wed Jun 25 10:50:46 2008 -0700
+++ b/space/MMgc/GCHeapWin.cpp  Mon Jun 30 16:53:59 2008 -0700
@@ -350,7 +350,7 @@
                void *addr = VirtualAlloc(address,
                                                        size,
                                                        MEM_COMMIT,
-                                                       PAGE_READWRITE);
+                                                       PAGE_EXECUTE_READWRITE);

 #ifdef _DEBUG
                if(addr == NULL) {
                        MEMORY_BASIC_INFORMATION mbi;
-----------------


BTW, This is a minor typo. In nanojit.h it should be fixed as follows.
This typo was around for a while.
---
- #ifndef __nanojit_h_
+ #ifndef __nanojit_h__
---

Thanks,

Jungwoo Ha
jungwoo.ha at intel.com


More information about the Tamarin-devel mailing list