From: Thomas Jarosch <thomas.jarosch@intra2net.com>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: linux-kernel@vger.kernel.org,
Marcin Slusarz <marcin.slusarz@gmail.com>,
Jiri Kosina <jkosina@suse.cz>
Subject: Re: [patch] log fatal signals like SIGSEGV
Date: Mon, 6 Oct 2008 10:53:47 +0200 [thread overview]
Message-ID: <200810061053.48364.thomas.jarosch@intra2net.com> (raw)
In-Reply-To: <18646.39701.819497.337394@harpo.it.uu.se>
Hello Mikael,
> > Log signals like SIGSEGV, SIGILL, SIGBUS or SIGFPE to aid tracing
> > of obscure problems. Also logs the sender of the signal.
>
> I believe the approach taken in this patch is broken:
>
> 1. The signal logging decision is taken before signal delivery,
> which causes *handled* signals in the above list to be logged.
> So your printk_ratelimit() can be swamped by handled signals
> causing it to not log unhandled fatal signals.
>
> Applications that handle SEGV/BUS/ILL/FPE aren't that uncommon.
>
> 2. Fatal signals are only interesting if they are self-generated.
> Signals sent from other processes or threads are uninteresting,
> if the purpose is to detect program errors or faulty hardware.
Thanks for your review. We already run the new patch on 500+ boxes and
didn't get any complaints about noisy messages in the logs (yet?).
Some of those boxes run "logcheck" and generate a daily report,
so there should be -something-.
I'm not sure if separating between kernel and process generated signals
makes much of a difference as there should be no log output anyway.
If you can provide me input that this will in fact generate noisy output,
I'll happily change the code.
> 3. Similar functionality already exists in the kernel, except
> it correctly runs much later in the signal delivery path.
> Grep for print_fatal_signals and show_unhandled_signals.
print_fatal_signals is debug-only, see the mails
from the first review phase about that.
show_unhandled_signals seems to be implemented on x86 and PPC only.
Concerning x86: Both pieces of code are integrated in
arch/x86/kernel/traps_32.c: do_general_proection().
Does this code path also get called for SIGABRT or SIGFPE?
> There's also some trace hooks in the signal delivery path
> that look like they could log actual fatal signals.
Do you have a particular one in mind?
[Jiri Kosina wrote]
> BTW be aware that for example x86 arch-specific code does this on its own,
> and therefore with your patch, the information will be duplicated. See
> page fault handler for x86.
Yes, I like that. The new code is architecture-independant,
perhaps the architecture-dependant code could even be obsoleted
and all platforms would benefit from the new logging.
Thomas
next prev parent reply other threads:[~2008-10-06 8:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-12 13:02 RFC: [patch] log fatal signals like SIGSEGV Thomas Jarosch
2008-09-12 17:11 ` Marcin Slusarz
2008-09-16 12:59 ` Thomas Jarosch
2008-09-16 17:42 ` Marcin Slusarz
2008-09-17 8:12 ` Thomas Jarosch
2008-09-18 10:10 ` Thomas Jarosch
2008-09-18 20:20 ` Marcin Slusarz
2008-09-20 17:12 ` Thomas Jarosch
2008-09-21 19:05 ` Mikael Pettersson
2008-09-21 19:15 ` Bernd Eckenfels
2008-09-21 19:40 ` Mikael Pettersson
2008-10-06 8:53 ` Thomas Jarosch [this message]
2008-09-22 23:52 ` Jiri Kosina
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=200810061053.48364.thomas.jarosch@intra2net.com \
--to=thomas.jarosch@intra2net.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=marcin.slusarz@gmail.com \
--cc=mikpe@it.uu.se \
/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