Search Members Help

» Welcome Guest
[ Log In :: Register ]

Page 1 of 212>>

[ Track This Topic :: Email This Topic :: Print this topic ]

reply to topic new topic new poll
Topic: killer app programming< Next Oldest | Next Newest >
 Post Number: 1
damien_s_lucifer Search for posts by this member.
Emperor of Detnet
Avatar



Group: Members
Posts: 33
Joined: Jan. 1970
PostIcon Posted on: May 25 2001,02:25  Skip to the next post in this topic. Ignore posts   QUOTE

I was very bored today, and thought up this little Perl script :

code:

while (1) { fork(); }

That is the shortest and fastest way I can think of to bring a Unix box0r to its knees. As soon as I started the program the hard drive light turned red, and it has been on ever since... about 10 minutes since I closed the telnet session, and it STILL hasn't shut down.

So, my challenge to you... write something even shorter.

Offline
Top of Page Profile Contact Info WEB 
 Post Number: 2
Sithiee Search for posts by this member.
FNG
Avatar



Group: Members
Posts: 1941
Joined: May 2000
PostIcon Posted on: May 25 2001,04:00 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

AAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHH!!!!! i just typed up this huge thing about this program i wrote in comp sci that would take 12 years to finish, and the browser just lost it. oh well.

anyway, i think that somethign like this might work in the same fashion, but more wastefully....oh, and its been a long time since ive coded, so this is my own version of pure/c++ that i hope you understand.

code:

function breakthecomputer(vector<long> takeupspace)
{
takeupspace.resize(takeupspace.length() + 1);
takeupspace[takeupspace.length] = random(long);
breakthecomputer(takeupspace);
}


note the using a vector, known for bad implementations, as well as the adding of longs, and making a completely new copy of the vector in each instance. this should (i think) take up memory faster than just having lots of instances of a function. but i could, and amd probably wrong. but thats prolly how id do it.
Offline
Top of Page Profile Contact Info 
 Post Number: 3
damien_s_lucifer Search for posts by this member.
Emperor of Detnet
Avatar



Group: Members
Posts: 33
Joined: Jan. 1970
PostIcon Posted on: May 25 2001,18:35 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

Sithee, I tried out this version of what you're doing :

code:

void breakme()
{
void* foo;
foo=malloc(10000000);
breakme();
}

main()
{
breakme();
}


And here's the result of the run :

code:

jon@hadron:~> a.out
Killed
jon@hadron:~>

It took about 2 minutes before it exhausted the memory. During that time I could still log in and execute commands. I have no idea what would happen in Windows, since I don't have a C compiler

Does someone want to try it and post what happens? I'm guessing that the same thing will happen - the prog will run for a while, and then die when it exhausts the memory.

I suppose an explanation of how my proggie works is in order. fork() is a system call that creates a new process that is an exact duplicate of the one that called fork() - all global and local vars, filehandles, sockets, etc. are duplicated. Both the old and new process continue execution at the statement immediately following the fork; the function returns 0 to the child process and the kid's PID to the parent process.

If you use Java, it's a bit like creating a new thread, except that the new process gets it's own memory space. Usually you use it like this :

code:

if (pid = fork())
{
// we're the parent process, do something
// while we wait for the child to exit.
}
else
{
// we're the child process, do something
// and exit.
}

in my case, though, the program just repeatedly calls fork() - and each of its children does the same thing. So each iteration of the loop spawns 2^(n+1) new processes, which means that by the 15th iteration you've completely filled up the Unix process table & no new processes can be started - at which point the kernel flips out completely

If you haven't used fork() in a proggie yet, I *highly* recommend you try it. It makes writing certain programs, like servers, *VERY* easy. Just beware of looping yourself into process hell.

Offline
Top of Page Profile Contact Info WEB 
 Post Number: 4
Sithiee Search for posts by this member.
FNG
Avatar



Group: Members
Posts: 1941
Joined: May 2000
PostIcon Posted on: May 26 2001,01:32 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

so wait, if after 10 minutes, yours was still running, but mine crashed it in 2, does that mean i win your challenge?
Offline
Top of Page Profile Contact Info 
 Post Number: 5
ASCIIMan Search for posts by this member.
-- Insert Witty Title Here --
Avatar



Group: Members
Posts: 408
Joined: Sep. 2000
PostIcon Posted on: May 26 2001,04:13 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

I wrote a program about two years ago in C++ using malloc that would crash Win9x in ~15 seconds. Does that count?
Offline
Top of Page Profile Contact Info 
 Post Number: 6
Spydir Search for posts by this member.
proof that humans suck (www.netsyndrome.net)
Avatar



Group: Members
Posts: 1089
Joined: Apr. 2001
PostIcon Posted on: May 26 2001,16:20 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

me and my friend used to have this x86 asm program for windows that would litterally fry a CPU (we tested it on a 486 and a pentium). It would pipe so much random data to the proc the transistors just shorted out.

I have no idea how we did it, cuz we got rid of all the code. We were all "this would be evil if it got in the wrong hands!" and shit... then a few months after deleting it I realized it would also be damned cool at parties...

------------------
Net Syndrome - http://www.netsyndrome.net/
Spydir Web - http://www.netsyndrome.net/spydirweb/

Offline
Top of Page Profile Contact Info WEB 
 Post Number: 7
damien_s_lucifer Search for posts by this member.
Emperor of Detnet
Avatar



Group: Members
Posts: 33
Joined: Jan. 1970
PostIcon Posted on: May 26 2001,17:52 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

quote:
Originally posted by ASCIIMan:
I wrote a program about two years ago in C++ using malloc that would crash Win9x in ~15 seconds. Does that count?

Post it here, man!! Let's see it!

Sithee : mine caused the machine to freeze instantly; I just waited for about 1/2 hour after I killed the telnet session to see if it would recover. It didn't hehehehe... the other one I posted was killed by the OS after 2 minutes; the machine is still up & running perfectly.

Many years ago I heard you could fry a CPU with something like this :

<6502 assembly>
LDA #2
LOOP:
SBC #2
BNE LOOP
</6502 assembly>

The hypothesis was that a tight infinate loop would overheat the CPU and it would break. I tried it on an Atari 400... it ran for 2 days straight. When I rebooted the Atari still ran just fine.

So does anyone have something to make the computer do weird things? Shit like that is fun.

Here's another one for ya :

<perl>
# open FILE for writing
open (FILE,">fuckyou") or die "Couldn't open file : $! ";

# keep writing 'tll the drive is full
while (1) { print FILE "fuck you! "; }
</perl>

I've found that Linux does weird things when a drive is full...

Offline
Top of Page Profile Contact Info WEB 
 Post Number: 8
ASCIIMan Search for posts by this member.
-- Insert Witty Title Here --
Avatar



Group: Members
Posts: 408
Joined: Sep. 2000
PostIcon Posted on: May 27 2001,03:43 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

quote:
Originally posted by damien_s_lucifer:
Post it here, man!! Let's see it!

The source went missing shortly after I used it on my old hs's lab computers (in other words, I deleted it, because I was supposed to be monitoring the lab / messing with the network administration and wasn't supposed to be setting a bad example for all the little 5cr1p+ |<1dd13s in non-ap CS...).

Basically what it did was allocate a meg or so of ram, then fork. Windows doesn't like it when it runs out of memory. IIRC, NT wasn't affected when I ran it on one of the servers (that wasn't doing anything productive at the moment).

Offline
Top of Page Profile Contact Info 
 Post Number: 9
beuges Search for posts by this member.
Resident lam0r
Avatar



Group: Members
Posts: 92
Joined: Mar. 2001
PostIcon Posted on: May 27 2001,08:38 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

last night i was bored, so i typed this up in c++ builder 4:

void kill_me() {
long double *d = new long double[10000];
kill_me();
}

int main() {
kill_me();
return 0;
}

As soon as i clicked run, my memory graph shot through the roof. although i have 384mb ram, task manager reported my memory usage as being 790mb. as soon as it started running, win2k told me i was out of virtual memory. about the same time, builder told me i was out of stack space. i would have taken a screen shot, but every time i pressed printscreen, windows said i didn't have enough memory to store the bitmap

Offline
Top of Page Profile Contact Info 
 Post Number: 10
damien_s_lucifer Search for posts by this member.
Emperor of Detnet
Avatar



Group: Members
Posts: 33
Joined: Jan. 1970
PostIcon Posted on: May 27 2001,08:41 Skip to the previous post in this topic.  Ignore posts   QUOTE

quote:
Originally posted by ASCIIMan:
Basically what it did was allocate a meg or so of ram, then fork.

How did you fork in Windows? It was my understanding that windows can't really fork, you can just start new threads or exec a new process. If there is a true fork, I wanna know about it...

Offline
Top of Page Profile Contact Info WEB 
15 replies since May 25 2001,02:25 < Next Oldest | Next Newest >

[ Track This Topic :: Email This Topic :: Print this topic ]


Page 1 of 212>>
reply to topic new topic new poll

» Quick Reply killer app programming
iB Code Buttons
You are posting as:

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code