Re: Segmentation fault details?

From: Alan Jenkins
Date: Mon Aug 11 2008 - 04:40:22 EST


Wang Yi wrote:

> Hi, all!
>
> ÂI'd like to know some details about segmentation fault.
> ÂWhat I mean is when a program accesses invalid memory area, it will
> get a SIGSEGV signal from kernel, and a message "Segmentation fault".
>
> ÂI also find that dmesg can show we something like this:
> ÂProgramName[Pid]: segfault at xxxx eip xxxx esp xxxx error x
> ÂIt is useful and provides the first-step information for further
> debug/analysis.
>
> ÂMy question is how dmesg gets the information, and if there are any
> "decent" way to get this and maybe more information(An "indecent" way
> I came to is grep dmesg)
> so that I can perform some basic auto analysis.
>
> ÂThank you.
>
> Leo

Core dumps.

You might also like to look at Ubuntu's "apport" bug reporting tool. ÂIIRC
the necessary kernel support is now in mainline. ÂI believe it provides the
option to dump core by piping it through an arbitrary program. ÂThe aim of
apport is to capture these core dumps, notify the user, and give them the
option to submit it to the Ubuntu developers.

One advantage of this last feature is that you don't need to search the
filesystem for core files. Â(They're dumped in the current directory, but
you may not know what directory the program was in when it crashed).

Alan

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