We used to wait until the first invocation of a MTask to set the
start of the stack, but that sometimes resulted in passing the nullptr
address to ASAN when calling a task for the first time.
It resulted in ASAN skipping the stack switch, logging something like:
```
WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x000000020000; bottom 0x7f18f174a000; size: 0xffff80e70e8d6000 (-
139745106763776)
False positive error reports may follow
```
Then almost right away complaining about a stack-use-after-scope,
or a stack-based overflow.
This changes sets the end of the memory allocation before the first
invocation, so that we always notify a valid value. A closer
approximation is still set during the first invocation, as before.
++d_threadsCount;
auto& thread = d_threads[d_maxtid];
auto mt = this;
+ // we will get a better approximation when the task is executed, but that prevents notifying a stack at nullptr
+ // on the first invocation
+ d_threads[d_maxtid].startOfStack = &uc->uc_stack[uc->uc_stack.size()-1];
thread.start = [start, val, mt]() {
char dummy;
mt->d_threads[mt->d_tid].startOfStack = mt->d_threads[mt->d_tid].highestStackSeen = &dummy;