Set SGen's REDZONE_SIZE=0 on Win64 since the ABI defines no red zone and the
authorNiklas Therning <niklas@therning.org>
Thu, 4 Aug 2016 14:07:11 +0000 (16:07 +0200)
committerNiklas Therning <niklas@therning.org>
Thu, 4 Aug 2016 14:07:11 +0000 (16:07 +0200)
commiteb9d4b44e785dbb340b38d4d2d3aa68a2f4d75e3
treeba855388fec18f378734832b6cc6ea6b3c547b03
parentc0bd75d8cda542039cf325d1f7cb39214d7ce71e
Set SGen's REDZONE_SIZE=0 on Win64 since the ABI defines no red zone and the
ABI states that "All memory beyond the current address of RSP is considered
volatile".

On Windows the stack grows dynamically as the thread needs more stack space.
Windows places a guard page before the page at the top of stack and when this
guard page is accessed by the thread Windows will add a new page to the stack
and resume the thread.

Before this fix SGen on Win64 subtracted 128 from the stack pointer of a
suspended thread and started the stack scan from this address. In the case
when the stack pointer would be less than 128 from the start of the memory
page SGen would attempt to read from the previous page. If this happens to be
the guard page a STATUS_GUARD_PAGE_VIOLATION exception is raised and the
process crashes. The sgen-weakref-stress.exe triggered this bug on almost
every invocation.
mono/sgen/sgen-archdep.h