All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Andi Kleen <ak@muc.de>, Mark Gross <markgross@thegnar.org>,
	Ingo Molnar <mingo@elte.hu>, Alexander Viro <viro@math.psu.edu>,
	S Vamsikrishna <vamsi_krishna@in.ibm.com>,
	linux-kernel@vger.kernel.org,
	NPT library mailing list <phil-list@redhat.com>
Subject: Re: [patch] thread-aware coredumps, 2.5.43-C3
Date: Fri, 18 Oct 2002 04:40:41 +0200	[thread overview]
Message-ID: <20021018024041.GA4015@averell> (raw)
In-Reply-To: <3DAF70B5.5010208@redhat.com>

> > I want the x86 CPU error code, which often has interesting clues on
> > the problem.
> > trapno would be useful too. I suspect other CPUs have similar extended
> > state for exceptions.
> 
> 
> I don't know whether you refer to this but the si_erno and si_code field
> of the elf_siginfo structure are currently not used.  They are filled
> with zero all the time.

Could be used yes.

> > Eventually (in a future kernel) I would love to have the exception
> > handler save the last branch debugging registers of the CPU and the
> > let the
> > core dumper put that into the dump too.  Then you could easily
> > figure out what the program did shortly before the crash.
> 
> 
> One the 2.7 kernel development opens I hope *a lot* will change in the
> core dump handling.  The current format isn't even adequate to represent
> the currently represented information correctly (uid and gid are 16
> bits) and there is other information which isn't even available.

You can always extend it with more elf notes.

> 
> I'm perfectly willing to consult anybody who wants to do some work in
> this area.  Actually, the kernel side should be mostly simple, it "just"
> means accessing and copying the right data.

At least the debugging register access is not that simple. The exception
handler has to be changed into an interrupt gate (to avoid interrupts
messing up the state) and then the debugging msrs have to be saved before
doing any other jumps. Worse they are CPU specific (P6, P4, and Athlon
have it different MSRs. You probably don't want that overhead
for normal page faults (reading MSRs is quite costly), so it would need 
special entry points and could be only done for GPF etc. not for normal
segfault. Still I think it would be worth it.

More state that could be saved are all the %dr* bits for hardware breakpoint
exceptions.

-Andi

  reply	other threads:[~2002-10-18  2:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-08 12:09 [patch] thread-aware coredumps part 1, tcore-2.5.41-A6 Ingo Molnar
2002-10-08 13:30 ` mgross
2002-10-17  9:11   ` [patch] thread-aware coredumps, 2.5.43-C3 Ingo Molnar
2002-10-17 16:40     ` Daniel Jacobowitz
2002-10-21 14:29       ` Alan Cox
2002-10-21 14:54         ` Daniel Jacobowitz
2002-10-21 16:16           ` Alan Cox
2002-10-21 16:04             ` Daniel Jacobowitz
2002-10-17 21:07     ` mgross
2002-10-18  0:48       ` Daniel Jacobowitz
2002-10-18 13:57         ` Mark Gross
2002-10-18 14:03           ` Mark Gross
2002-10-19 13:26           ` Mark Kettenis
2002-10-19 19:26           ` Bill Davidsen
2002-10-19 19:34             ` Ulrich Drepper
2002-10-19 13:20         ` Mark Kettenis
2002-10-19 18:42           ` Mark Gross
2002-10-18  1:10     ` Andi Kleen
2002-10-18  1:35       ` Mark Gross
2002-10-18  2:12         ` Andi Kleen
2002-10-18  2:58           ` Mark Gross
2002-10-18  3:55             ` Daniel Jacobowitz
2002-10-18 14:00               ` mgross
2002-10-21 15:17             ` Pavel Machek
2002-11-03  7:32               ` Ulrich Drepper
2002-10-19 17:32     ` Ulrich Drepper
2002-10-18  2:23   ` Ulrich Drepper
2002-10-18  2:40     ` Andi Kleen [this message]
2002-10-08 18:04 ` [patch] thread-aware coredumps part 1, tcore-2.5.41-A6 mgross

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=20021018024041.GA4015@averell \
    --to=ak@muc.de \
    --cc=drepper@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@thegnar.org \
    --cc=mingo@elte.hu \
    --cc=phil-list@redhat.com \
    --cc=vamsi_krishna@in.ibm.com \
    --cc=viro@math.psu.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.