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@winehq.org ReportedBy: focht@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