Re: core files (was Re: 2.1.131: some quality thoughts)

Raul Miller (rdm@test.legislate.com)
Tue, 29 Dec 1998 17:45:23 -0500


> > I would absolutely hate this. I personally like core files and find them
> > very useful. I would be upset if I had to go through the overhead of
> > starting any debugger when a program dropped core.

Albert D. Cahalan <acahalan@cs.uml.edu> wrote:
> ROTFL! Most people need a debugger to analyse a core file.
> If you just want the core file:
> dd if=/dev/null or=/core bs=1k count=42

Actually, "strings" is often quite informative about core files.

Also, for what it's worth, I wrote what I think of as a rather nice
little core analysis routine which works under solaris. However, I've
not yet decided what to do about the absence of definition for a NOTE
header under linux (nor have I looked closely enough to determine if
it's present, or what's used in its place).

> Core files are just not good. Once a program cores, all the file
> descriptors are closed. All the interprocess relationships are
> destroyed. You can't debug as well after all the connections are
> severed.

I'll grant that they're not ideal. But they are useful.

However, note that it's often possible to run the buggy program under
gdb to track down a reproducible bug. Bugs that are not reproducible
are rather hard to debug even if you are lucky enough to snag them when
they finally croak -- one of the most valuable techniques (binary search
through the code to find if an data structure is damaged) isn't viable
if the bug isn't reproducible.

Also, don't overlook the value of strace in bug tracking. Often it's
even more valuable than gdb.

-- 
Raul

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/