Messages in this thread | | | From | "Peter T. Breuer" <> | Subject | Re: Avoiding OOM on overcommit...? | Date | Wed, 29 Mar 2000 00:26:33 +0200 (MET DST) |
| |
"A month of sundays ago Andreas Bombe wrote:" > > I also think that you start off with less stack than that and libc > > or stuff embedded in your code by gcc makes sbrk() calls to grow the > > stack up to your rlimit as necessary. > > Not at all. The stack is managed by the kernel and grown as > necessary.
I stand enlightened. Thank you. It doesn't affect the argument above, however, since the point was that the programmer doesn't control the (max) stack available to him. So one needs to reserve swap backing for the max stack size in a secure process.
> The stack is in no way associated with the data heap and > neither libc nor gcc care about stack usage. The stack is simply > there (and will grow as needed) and cannot be managed by the program. > > You could use your own allocated stack in the data heap though, that's > what multithreaded programs have to do since a stack can't be shared.
Please don't tell me how it's done. I'd hate to know how to execute a program in a malloced area! Come to that. I'd hate to know how to exec code in a mallloced string. It must be assembler ..
Peter
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |