[Bug 12351] New: thread stack PAGE_GUARD/overflow handling ( NT compatibility)

wine-bugs at winehq.org wine-bugs at winehq.org
Thu Apr 3 15:34:00 CDT 2008


http://bugs.winehq.org/show_bug.cgi?id=12351

           Summary: thread stack PAGE_GUARD/overflow handling (NT
                    compatibility)
           Product: Wine
           Version: CVS/GIT
          Platform: All
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: minor
          Priority: P1
         Component: -unknown
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: focht at gmx.net


Hello,

this one is just follow up of recent .NET page guard patch commits, as
requested by AJ ;-)
Low priority.

--- snip example code ----
MEMORY_BASIC_INFORMATION mbi;
DWORD oldProtect;

SetLastError(0xdeadbeef);
ok(VirtualQuery( &mbi, &mbi, sizeof(MEMORY_BASIC_INFORMATION)) == sizeof(mbi));
ok(!VirtualProtect( mbi.BaseAddress, mbi.RegionSize, PAGE_GUARD, &oldProtect));
ok(GetLastError() == ERROR_INVALID_PARAMETER);
--- snip example code ----

Glibc mprotect() code triggers the segfault.

Another test for NT compatibility, touch the last guard page...  

--- snip example code ----
void stack_overflow()
{
    char eat_stack[0x4000];
    stack_overflow();
}

__TRY
{
    stack_overflow();
}
__EXCEPT(UnhandledExceptionFilter)
{
    ok(GetExceptionCode() == EXCEPTION_STACK_OVERFLOW);
}
__ENDTRY

__TRY
{
    stack_overflow();
}
__EXCEPT(UnhandledExceptionFilter)
{
    ok(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION);
}
__ENDTRY
--- snip example code ----

Regards


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list