If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Access Violation on Windows Server 2003

VERIFIED FIXED

Status

Tamarin
Garbage Collection (mmGC)
--
major
VERIFIED FIXED
9 years ago
8 years ago

People

(Reporter: Jungwoo Ha, Unassigned)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.1; MS-RTC LM 8; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
Build Identifier: 

Tamaring tracing crashes with Access Violation at the callsite to JITed code in Interpreter::loopEdge() on Windows Server 2003. The one I tested is Enterprise x86 edition with Service Pack 1. 
This doesn't happen on Windows XP.
Following patch fixes the problem. Please verify if this is the right way to fix the problem. 

----------------------------------
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;



Reproducible: Always

Steps to Reproduce:
1.
2.
3.
This sounds like bug 432683 -- I posted a patch for it in bug 320299 (review+'d but no one has pushed it yet).  It looks like yours fixes a different API call though so maybe both should go in.
Best to attach the patch via the "Add an attachment" link in the bug.

/be
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Reporter)

Comment 3

9 years ago
Created attachment 327705 [details] [diff] [review]
Patch to work on Windows Server 2003 where DEP is turned on by default
(Reporter)

Comment 4

9 years ago
As David mentioned it seems to be related to DEP(Data Execution Prevention) in Windows. It is default in Windows Server 2003 for all applications while it is turned off in Windows XP for user applications. After turning DEP off, code works fine without the patch.

Comment 5

9 years ago
Comment on attachment 327705 [details] [diff] [review]
Patch to work on Windows Server 2003 where DEP is turned on by default

only question i have is whether we want to initially have the pages readwrite, then mark them execute+read, but not write.

iow, nothing writable should be executable.

if too complicated for now, can we create a bug to follow up with this pattern later?
Attachment #327705 - Flags: review?(treilly)

Comment 6

9 years ago
Comment on attachment 327705 [details] [diff] [review]
Patch to work on Windows Server 2003 where DEP is turned on by default

We should never mark normal memory as EXECUTE, nanojit should be using CommitCodeMemory not CommitMemory
Attachment #327705 - Flags: review?(treilly) → review-
(Reporter)

Comment 7

9 years ago
Tom, this happens to unmodified TT code. Maybe there is a bug that nanojit is using CommitMemory.

Comment 8

9 years ago
I think this bug is fixed with Ed's 64 bit LIR
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Comment 9

8 years ago
Resolved fixed engineering / work item that has been pushed.  Setting status to verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.