public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Calvin Walton <calvin.walton@gmail.com>
To: 7eggert@gmx.de
Cc: Wang Yi <leonidwang@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: Segmentation fault details?
Date: Sat, 23 Aug 2008 23:26:04 -0400	[thread overview]
Message-ID: <1219548364.15228.4.camel@zem> (raw)
In-Reply-To: <E1KWzeO-0004TU-Hr@be1.7eggert.dyndns.org>

On Sat, 2008-08-23 at 22:23 +0200, Bodo Eggert wrote:
> Wang Yi <leonidwang@gmail.com> wrote:
> 
> >  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.
> 
> I'm wondering if the default handler might print this information isntead
> of the plain segmentation violation.

If you want to debug a segfaulting user-space program, there's a
somewhat better way to get this information (and a whole lot more info,
too...), and it's been around in various unixes for ages: core dumps
(core files).

Unfortunately (but given the state of modern linux desktop programs,
understandably), most current linux distributions ship with core dumps
turned off. But it isn't too hard to turn them back on if you have a
segfaulting program that you want to debug.

-- 
Calvin Walton <calvin.walton@gmail.com>


  reply	other threads:[~2008-08-24  3:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <aZzy0-8hH-13@gated-at.bofh.it>
     [not found] ` <aZzy0-8hH-15@gated-at.bofh.it>
     [not found]   ` <aZzxZ-8hH-11@gated-at.bofh.it>
2008-08-23 20:23     ` Segmentation fault details? Bodo Eggert
2008-08-24  3:26       ` Calvin Walton [this message]
     [not found] <ac94cb270808102334m1cc2c3a1n45202072d309927c@mail.gmail.com>
     [not found] ` <ac94cb270808102337i5febf70fkb6d1f27f71cafb34@mail.gmail.com>
2008-08-11  6:55   ` Wang Yi
2008-08-11  8:35     ` Alan Jenkins
2008-08-11  8:36     ` Alan Jenkins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1219548364.15228.4.camel@zem \
    --to=calvin.walton@gmail.com \
    --cc=7eggert@gmx.de \
    --cc=leonidwang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox