Re: Recursive malloc crashing Linux. (Well almost)

Giuliano Pochini (pochini@denise.shiny.it)
Fri, 17 Dec 1999 20:05:22 +0100


> # ./killmem
> Allocating 256 amounts of 4MB == 1024MB
> Successful
> Filling block 0
> Filling block 1
> killmem: memory violation at pc=0x0200047c, lr=0x4005f7d8 (bad address=0x4065d000, code 1)
> Bus error
>
> Which is kind of not very graceful. On my PC, 128MB ram, ~133MB swap, it
> gets as far as block 34 (136MB) before causes a complete lockup (not even
> magic sysrq works) - which is also not very graceful.

It seems to crash when it tries to expand the stack and there is no available
mem. If you try:

while(1){
malloc(256K);
fill;
}

the program will be killed. But an infinite recurse will crash even if you
don't malloc anything.

> Has anyone got any other solutions to this ?

No :-( Someone should have a look into the code which expands the stack...

Bye.

-
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/