From: Ajay Shah (ajayshah@almaak.usc.edu)
Date: 08/04/92


From: ajayshah@almaak.usc.edu (Ajay Shah)
Subject: This program hangs Linux
Date: 5 Aug 1992 04:25:28 GMT


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

int main()
{
    int i, size, *x;

    x = malloc(sizeof(int)); size=3;
    do {
        printf("About to realloc to size %d\n", size);
        x = realloc(x, size*sizeof(int));
        if (x == NULL) {
            printf("Realloc failed at size=%d\n", size);
            return 1;
        }
        for (i=0; i<size; i++) x[i] = 14;
        size = (int) (1.5*((float) size));
    } while (1);
}

-- 
Ajay Shah, (213)749-8133, ajayshah@usc.edu