[sgen] Initialize stack_start to 0 when a thread is signaled for stw
authorVlad Brezae <brezaevlad@gmail.com>
Tue, 12 Jul 2016 16:30:01 +0000 (19:30 +0300)
committerVlad Brezae <brezaevlad@gmail.com>
Wed, 13 Jul 2016 17:04:51 +0000 (20:04 +0300)
commitab46df8888ba42e70aa31ae33f2b7d52c602e8d1
tree60cc8c749d6be05b9e4534047352905db6a4bd00
parent725892b35c29fe919d6e58305ac241f6cbd01018
[sgen] Initialize stack_start to 0 when a thread is signaled for stw

If we have an invalid SP in the suspended thread, we don't set stack_start in the thread info, expecting it to be 0 in order to signal a resume and suspend retry to the suspender thread. If the thread was already restarted before (from a different reason like IP in critical section), it would have a nonzero stack_start from the previous suspend, leading to an assertion in the previously described case.

This is also what we do on mach.
mono/metadata/sgen-os-posix.c