Jump to content

C program from Hell

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
9 replies to this topic

#1
Guest

Guest

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,414 posts
Edit: This will not actually crash your computer. It just makes it very slow. Run the program and monitor how much RAM and processor this takes up!
#include <stdlib.h>

int main()
{
	for (;;)
	malloc(1);
	return 0;
}

Edited by Guest, 11 October 2009 - 07:30 AM.

Root Beer == System Administrator's Beer
Download the new operating system programming kit! (some assembly required)

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
No, eventually the program itself will exhaust available resources and it will stop allocating memory and sit in an infinite loop. It'll consume all available processor, though.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Guest_Jordan_*

Guest_Jordan_*
  • Guests
lol, why did you make this? Are you planing on sending it to a friend as a joke? :)

#4
Guest

Guest

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,414 posts

Jordan said:

lol, why did you make this?
I don't know, inspiration just came to me.

Jordan said:

Are you planing on sending it to a friend as a joke? :)
You're giving me bad ideas! :bad:
Here are some screen shots.

Before:
Posted Image
While running it:
Posted Image
Aftermath:
Posted Image
Root Beer == System Administrator's Beer
Download the new operating system programming kit! (some assembly required)

#5
ZekeDragon

ZekeDragon

    Writes binary right handed and hex left handed

  • Moderators
  • 2,103 posts
*laughs* Did you notice? It started eating through your swap. XD
Wow I changed my sig!

#6
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
This is why I always use ulimit on my servers :)

#7
Guest

Guest

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,414 posts

ZekeDragon said:

*laughs* Did you notice? It started eating through your swap. XD

Yeah, I noticed. When the program started using swap, my computer slowed down a lot. I wonder, does anyone else have enough courage to try this out?
Root Beer == System Administrator's Beer
Download the new operating system programming kit! (some assembly required)

#8
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
Haha I tried it.. And I thought my computer was slow before.. :scared:
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#9
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
Because we CAN :D It's what useless programs are all about
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#10
Jrb

Jrb

    Learning Programmer

  • Members
  • PipPipPip
  • 49 posts
Rofl. Very nice. I'm gonna use this as a prank :w00t: