* luciano ([EMAIL PROTECTED]) wrote:
> What are the core dumps?Can i just delete the core dump file (the one that
> is red in mc)?

When a program crashes, a core file is created.

[The name core is thought to stem from when computer memory was made of
huge great magnetic cores.]

The core file contains the last, dying moments of the program, and can
be used to fix the problem causing the crash.

For example, I have a core file in my home directory,

If I don't know what crashed to create it, I use the 'file' command:

$ file core
core: ELF 32-bit LSB core file of 'gnome-session' (signal 6), Intel 80386, version 1

Ok, so we know gnome-session crashed (I've been cruel here! I forced
it to!).

Now we can use the core file to report the problem to the developer:

This will show you where the program was when it crashed, and why:

$ gdb gnome-session core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
Core was generated by `gnome-session'.
Program terminated with signal 6, Aborted.

This is useful in itself, we can see the program aborted with a signal
6.

Then gdb (Gnu Debugger) will load all the libraries the program uses,
and show you the last function the program was in:

#0  0x40405111 in __kill () from /lib/libc.so.6

[The libc __kill function]

You can then find out what happened with a backtrace (type bt):

(gdb) bt
#0  0x40405111 in __kill () from /lib/libc.so.6
#1  0x40404d66 in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x40406447 in abort () at ../sysdeps/generic/abort.c:88
#3  0x40080565 in gnome_segv_handle (signum=11) at gnome-init.c:653
#4  <signal handler called>
#5  0x3ffe8000 in ?? ()
#6  0x40267d1b in gdk_io_invoke () from /usr/lib/libgdk-1.2.so.0
#7  0x403d052a in g_io_unix_dispatch () from /usr/lib/libglib-1.2.so.0
#8  0x403d1be6 in g_main_dispatch () from /usr/lib/libglib-1.2.so.0
#9  0x403d21a1 in g_main_iterate () from /usr/lib/libglib-1.2.so.0
#10 0x403d2341 in g_main_run () from /usr/lib/libglib-1.2.so.0
#11 0x401be209 in gtk_main () from /usr/lib/libgtk-1.2.so.0
#12 0x804e2a7 in main (argc=1, argv=0xbffff834) at main.c:129

The ?? means gdb can't work out where or what the program was doing at
the time (either due to stack corruption, or a library with no symbol
information).

This is invaluable information for someone trying to fix a bug, and
you can really help them (and yourself) by reporting this info.

If you want, you can just delete the file, quite safely.

Tom.
-- 
            .-------------------------------------------------------.
    .^.     | Tom Gilbert, England | [EMAIL PROTECTED] |
    /V\     |----------------------| www.tomgilbert.freeserve.co.uk |
   // \\    | Sites I recommend:   `--------------------------------|
  /(   )\   | www.freshmeat.net www.enlightenment.org www.gnome.org |
   ^^-^^    `-------------------------------------------------------'

Reply via email to