[net.bugs.4bsd] Large sh input dumps core

pmontgom@sdcsmb.UUCP (Peter Montgomery) (10/24/85)

/***
 *      This program generates a sequence of lines reading
 *      "value=0" through "value=20000".  Run the generated
 *      output through "sh" using the ". filename" command.
 *      On a VAX 11/750, its memory space (shown by "ps ux") gradually
 *      increases to about 850K before getting "Illegal Instruction"
 *      and a core dump.  Analysis of the core dump via "strings core"
 *      shows "sh" aborted near "value=11841".
 *      On a SUN 170 Workstation, also running 4.2bsd, sh used
 *      1150K before aborting near "value=18683".
 *
 *      Problem submitted by Peter Montgomery of System Development
 *      Corporation in October, 1985.
 ***/

main()
{
	int line;
	for (line=0; line<=20000; line++)
		printf("value=%d\n", line);
}
-- 
			Peter Montgomery

	{aero,allegra,bmcg,burdvax,hplabs,
	 ihnp4,psivax,randvax,sdcsvax,trwrb}!sdcrdcf!sdcsmb!pmontgom

Don't blame me for the crowded freeways - I don't drive.