Stack will leak memory if growing beyond stack size
Closed this issue · 1 comments
sheepmax commented
This is quite unlikely to happen, but wanted to point out that if the mapping grows automatically, deallocating from stack_base will still leave the automatically allocated mapping. This is a memory leak. You could check that rsp is below stack_base in order to detect this, but this won't work if rsp goes below and then back above. I haven't been able to find any references to how to properly deal with this, maybe it's usually ignored? Even in this thread for coroutines in QEMU: https://patchwork.kernel.org/project/qemu-devel/patch/1467104499-27517-2-git-send-email-pl@kamp.de/.