[Python-Dev] stack check on Unix: any suggestions?

Thomas Wouters thomas@xs4all.net
Tue, 29 Aug 2000 22:26:53 +0200


On Tue, Aug 29, 2000 at 03:19:16PM -0500, Skip Montanaro wrote:

>     MAL> The C program can suck memory in large chunks and consume great
>     MAL> amounts of stack, it just doesn't dump core... (don't know what I'm
>     MAL> doing wrong here).

Are you sure you are consuming *stack* ?

> Are you overwriting all that memory you malloc with random junk?  If not,
> the stack and the heap may have collided but not corrupted each other.

malloc() does not consume stackspace, it consumes heapspace. Don't bother
using malloc(). You have to allocate huge tracks o' land in 'automatic'
variables, or use alloca() (which isn't portable.) Depending on your arch,
you might need to actually write to every, ooh, 1024th int or so.

{
    int *spam[0x2000];
	(etc)
}

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!