Re: [x86] Access off the bottom of stack causes a segfault?

From: Davide Libenzi
Date: Tue Oct 14 2003 - 13:43:14 EST


On Tue, 14 Oct 2003, Chris Lattner wrote:

>
> My compiler is generating accesses off the bottom of the stack (address
> below %esp). Is there some funny kernel interaction that I should be
> aware of with this? I'm periodically getting segfaults.
>
> Example:
>
> int main() {
> int test[4000];
> ...
> return 0;
> }
>
> Generated code:
> .intel_syntax
> ...
> main:
> mov DWORD PTR [%ESP - 16004], %EBP # Save EBP to stack
^^^^^^^^^^^^

Yes, this is the problem (even Windows does that IIRC).



- Davide

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/