Patch-ID# 100399-02 Keywords: csh while loop memory leak echo EOF tty Synopsis: SunOS 4.1;4.1.1: csh memory leak tty gets EOF condition Date: 10-Oct-91 SunOS release: 4.1 4.1.1 Topic: csh memory leak, tty gets EOF condition BugId's fixed with this patch: 1066556 1062988 1009620 1035458 1056394 1014273 1070306 1048065 Architectures for which this patch is available: sun3, sun3x, sun4, sun4c Patches which may conflict with this patch: Obsoleted by: SVR4 Problem Description: Bugid 1066556 - Memory leak results in Memory Fault error Bugid 1062998 - Csh allocates memory and doesn't release it anymore. After csh is invoked, and falls into a command execution mode, csh eats up all initial free memory it had. Then it uses sbrk() through malloc() to expand its data segment. (4096 bytes will be added to its data segments.) But these 4096 be eaten up and eventually, csh eats up all memory it can get. Bugid 1009620 - The 'foreach' command in csh increases process sizes Bugid 1035458 - The data and stack segment size (the SZ info in ps aux) of the csh in which a while(1) loop is running increases in size by 4kB every 35 passes. SZ for the csh reaches several megabytes in just a few hours! Bugid 1056394 - there appears to be a memory leak in the c-shell when calling a program Bugid 1014273 - The source option that's built into the cshell doesn't relinquish allocated memory. Bugid 1070306 - csh built-in command, 'echo', not working correctly Bugid 1048065 - In csh, set the "filec" option. Type "vi /usr/dict/wordsZZ" quickly. Vi starts up and exits, and the shell sees an end-of-file condition on the tty when vi is finished. If ignoreeof isn't set, the shell exits, logging the user out or closing his window. INSTALL: As root: Save the original copy of csh: mv /bin/csh /bin/csh.FCS Install the new copy of csh cp -p `arch`/{4,1,4.1.1}/csh /bin/csh chmod 0755 /bin/csh