Under Solaris 2.3 (and 2.4) on a sparc, the following program outputs
38912 `a's and then dumps core when standard output is a tty.
(The `38912' is crucial.)
#include <stdio.h>
#include <string.h>
#define MYSIZE 38912
char buf[MYSIZE + 1];
int main() {
memset(buf, 'a', MYSIZE);
printf("%s\n", buf);
return 0;
}
The amusing thing about this bug is that my Sun engineer says he can't
reproduce it. I've reproduced it on a half-dozen Suns of various types
in various stages of OS patching, using either GCC or Sunpro cc, with
an empty environment and with a full one, under xterm, `script', Emacs,
you name it.
Any clues as to why Sun can't reproduce it?