[PATCH] ARM and Thumb Segmented Stacks

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Feb 26 16:00:33 PST 2014


On 26 February 2014 18:49, Alex Crichton <alex at crichton.co> wrote:
>> Out of curiosity, hasn't rust moved away from using segmented stacks?
>> Or that was on X86 only?
>
> We did indeed drop segmented stacks, our green tasks now use one large
> stack instead of lots of little ones. We are still using the
> __morestack prologue to detect stack overflow, however. For us
> whenever the __morestack prologue is triggered it means that the task
> has overflowed the stack and we start the task failure machinery.
>
> We're still trying to get away from this (it's kinda overkill for what
> we're doing), but for the time being it's the best solution we have
> that LLVM implements.

I see. If you don't use dynamic allocas you should be able to get away
with checking at compile time the maximum frame size and allocating
stacks with a certain number of unallocated pages after them, no? I
think something like this got implemented in asan.

Cheers,
Rafael



More information about the llvm-commits mailing list