]> git.ipfire.org Git - thirdparty/pdns.git/commit
rec: Set the start of the stack right away to avoid an ASAN issue 10036/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 1 Feb 2021 11:51:44 +0000 (12:51 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 1 Feb 2021 11:51:44 +0000 (12:51 +0100)
commit818c97d8cea0aec27f719ff883a62831f72d709e
tree347d11671c92e79e18f1779eae3682b47454b78c
parenta341a16257fbf4606a9081c3d14fb95fa1baaa4d
rec: Set the start of the stack right away to avoid an ASAN issue

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.
pdns/mtasker.cc