From: Alastair B. <nye...@li...> - 2006-12-14 16:10:25
Attachments:
win32-stack-guard-page.diff
|
Hello all, Attached is a patch to make stack guard page reinstation on Win32 not suck completely. Based on 1.0.0.28, only tested on WinXP, almost guaranteed not to work on win9x, etc. One caveat: While testing this from toplevel REPL shows that the guard page is automatically reinstated, this is because the toplevel calls out to reinstate it. If you restart from a control stack overflow anywhere else you have to re-protect the guard page manually. --Alastair Bridgewater |
From: Nikodemus S. <nik...@ra...> - 2007-01-03 10:51:33
|
Alastair Bridgewater <nye...@li...> writes: > Hello all, > > Attached is a patch to make stack guard page reinstation on Win32 not > suck completely. Based on 1.0.0.28, only tested on WinXP, almost > guaranteed not to work on win9x, etc. > > One caveat: While testing this from toplevel REPL shows that the guard > page is automatically reinstated, this is because the toplevel calls > out to reinstate it. If you restart from a control stack overflow > anywhere else you have to re-protect the guard page manually. I have a similar tree uses instead _resetstkoflw instead of a homebrew reprotection. Is there an advangate to implementing it ourselves? Cheers, -- Nikodemus Schemer: "Buddha is small, clean, and serious." Lispnik: "Buddha is big, has hairy armpits, and laughs." |
From: Alastair B. <nye...@li...> - 2007-01-03 16:41:48
|
Nikodemus Siivola writes: > Alastair Bridgewater <nye...@li...> writes: > >> Hello all, >> >> Attached is a patch to make stack guard page reinstation on Win32 not >> suck completely. Based on 1.0.0.28, only tested on WinXP, almost >> guaranteed not to work on win9x, etc. >> >> One caveat: While testing this from toplevel REPL shows that the guard >> page is automatically reinstated, this is because the toplevel calls >> out to reinstate it. If you restart from a control stack overflow >> anywhere else you have to re-protect the guard page manually. > > I have a similar tree uses instead _resetstkoflw instead of a homebrew > reprotection. > > Is there an advangate to implementing it ourselves? Yes. _resetstkoflw isn't available on all library / header versions (as a specific instance: It's not in any include file under /usr/include/, including /usr/include/w32api/ on my system). A case could be made that we should use _resetstkoflw if it is available, and our own reimplementation otherwise but since it's a compile-time thing we'd need to make sure we don't lose wrt. runtime bindings. > Cheers, > > -- Nikodemus Schemer: "Buddha is small, clean, and serious." > Lispnik: "Buddha is big, has hairy armpits, and laughs." --Alastair Bridgewater |