The way this works is that a range in the address space is reserved, but the pages are not commited (that is, not assigned an actual memory resource). A guard page is included at the very end of this. When you touch this page, and touching means reading or writing to an address in that page, it will trigger a segfault. The OS will handle the segfault by commiting that memory, and making the addresses immediately after it as the new guard page. If you skip this guard page and touch an address after it, there is no way for the OS to know that the stack needs to grow. The segfault will be treated like any other regular segfault. The default behavior in a segfault is to crash.
There is a function that is purposely made to touch the bytes in order, which on Windows is called _chkstk. You call it right a the beginning of your function that uses a lot of stack, and this ensures that every page that you could possibly use in that function is already commited.
But if you can guarantee that the pages will be touched in order, or have already been touched, or have already been committed for any other reason, you’re safe, so you don’t have to call this function.
This instruction is simply setting up an argument to memset. I jumped a bit to conclusions before, so I’ll dial down. Memset has to touch every byte in a range. If you start from the high address and go towards the low address, that will touch every byte in order, so it dispenses with the need for _chkstk. That would be a very clever way to optimise this. Granted, I don’t know for sure that memset starts from the high address. If it starts from the low address, you’ll crash the same way.
But there are other ways to avoid the call to _chkstk. One way is to commit your entire stack all at once. That way, the problem of touching the pages in order disappears. You can still run out of stack, but that is a different problem.
You already start with some amount of stack committed. If you know that, when a function is called, the amount of commited stack is sufficient for it, you also don’t have to call _chkstk.