Memory/heapbust.c File Reference

Task to show code that crashes a C program. Provide code that exhausts all available memory and crashes. Make sure that you don't execute this program on a shared machine since it might force that machine to be rebooted. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Functions

char * cycle (char *s)
 Return string "abcdef" as "fabcde".
int main (int argc, char **argv)
 launch this program which may crash your machine.

Variables

int n
 Compute the number of times the program executes.


Detailed Description

Task to show code that crashes a C program. Provide code that exhausts all available memory and crashes. Make sure that you don't execute this program on a shared machine since it might force that machine to be rebooted.

Author:
George Heineman
Date:
6/15/08

Function Documentation

char* cycle ( char *  s  ) 

Return string "abcdef" as "fabcde".

int main ( int  argc,
char **  argv 
)

launch this program which may crash your machine.


Variable Documentation

int n

Compute the number of times the program executes.

When loading up core file after the crash, this will store the number of times program loop executed.

Algorithm Development Kit 1.0