/* Dump a trivial core file, for smoke testing the core file facility. No threads, no fancy data types, no deep stack trace - just a bare bones core dump. */ #include long foo = 3; int godump (int argc, char *arg) { int *bazzbarf = 0; printf ("Goodbye from %s\n", arg); fflush (stdout); foo -= 4; bazzbarf = (int*)foo; *bazzbarf = 123456789; printf ("Oops -- %s failed to crash\n", arg); return (argc); } int main (int argc, char **argv) { godump (argc, argv[0]); }