http://bugs.winehq.org/show_bug.cgi?id=10467
--- Comment #9 from Vitaliy Margolen vitaliy@kievinfo.com 2007-11-18 14:40:57 --- I'm not sure why you quoting something that's available by scrolling up. But just in case you need it, you can find it blow.
You didn't read it right. And you did not search the commit log for _WHY_ Wine does not use guard page. You really should and also look at all the mentioned bugs.
I'm telling you that stuff like starforce and securerom _WILL_ crash if you don't grow stack on guard page access. It HAVE TO be gown, or it HAVE TO BE no access page as it is now. Your hack is just that - a hack. It can not be used as is without implementing stack growth.
(In reply to comment #8)
Created an attachment (id=9240)
--> (http://bugs.winehq.org/attachment.cgi?id=9240) [details]
patch to fix bottom stack guard page to allow CLR exceptions from .NET runtime to succeed
Hello
--- quote --- That won't work. Wine does not grow stack. And does not use guard page. --- quote ---
--- quote --- When I did some testing on winnt+ the guard page was used only to grow stack. When the maximal stack size was reached (when it could not be grown anymore because of reserved space in the lover address space) windows allocated page with PAGE_NOACCESS. Exactly what Wine does now. Just allocating the maximum stack size instead. --- quote ---
Did you actually bother to read? I *never* intended to implement/mimick any dynamic stack growth using PAGE_GUARD like NT does. I just marked a single guard page location at bottom of stack and adjusted flags accordingly. O-N-E single stack guard page at thread stack B-O-T-T-O-M. If there is a guard page violation due to stack overflow then the usual overflow handling has to be extended to handle this case (just like wine currently does when PAGE_NOACCESS guard is encountered). There is no growth further. The app would be killed anyway.
--- quote --- So if what you saying is true the bug is in .net not Wine. However it would be nice for Wine to support growing stack. --- quote ---
This is the way windows NT based operating systems work. The Microsoft .NET runtime was never intended to run on other operating systems (except of shared source rotor, which differs in aspects). Why should the MS .NET runtime developers actually care that wine doesn't support this stuff?
--- quote --- What you did won't work for some programs that clear _whole stack space_ on exit. On windows they trigger stack growth. On Wine they just crash. --- quote ---
And? Whats the problem? In the rare cases such brain damaged programs won't work anymore just add internal last chance PAGE_GUARD violation handler, which clears the guard page flag and resume malware cleanup process. Done.
Anyway attached is version which takes user threads into account. This lets multithreaded .NET apps succeed too, which throw CLR exceptions from other than main thread.
Regards