mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* DoS tmpfs,ramfs, malloc, saga continues
@ 2001-08-14 13:29 Ivan Kalvatchev
  0 siblings, 0 replies; 4+ messages in thread
From: Ivan Kalvatchev @ 2001-08-14 13:29 UTC (permalink / raw)
  To: kernelbug

As Alan Cox pointed me, tmpfs bug is a VM bug. I was
able to reproduce the bug with a simple memory
"eating" program. (for the lazy ones copy-paste from
bottom).
As oom_kill.c says:
"...
*If we run out of memory, we have the choice between
either
 * killing a random task (bad), letting the system
crash (worse)
 * OR try to be smart about which process to kill.
Note that we
 * don't have to be perfect here, we just have to be
good.
 *
..."
Oh, how dumb. Now the system kills random tasks and
hangs with 50% probability. Just run the sample
program twice. Oh, system hangs while waiting for kill
(I wont wait for months). 
Good job for Alan Cox, with his patch i could run the
sample program 20 times before it crashed the system.
I cannot belive that instead of keeping this
masskiller for deathlocks, no way out situation, and
as last resort, You The Great Kernel Hackers use it
for every day and every body solution. Is it so hard
to make more memory checks for user level malloc?
Windows does. Every other OS does. Why linux doesn't? 
Fix it in the next kernel!

//-------------------eatmem.c-------------------
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
void *p;
	for(i=0;;i++)
	{
		p=malloc(4096);
		printf("malloc #%d (%p)\n",i,p);
		if(p==NULL) break;
	}
	printf("I can't free mem:)");
return 0;
}


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <no.id>]

end of thread, other threads:[~2001-08-20 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-14 13:29 DoS tmpfs,ramfs, malloc, saga continues Ivan Kalvatchev
     [not found] <no.id>
2001-08-14 20:42 ` Alan Cox
2001-08-15 14:20   ` Szabolcs Szakacsits
2001-08-20 13:48     ` Andrey Savochkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®