From: Ralf Baechle <ralf@linux-mips.org>
To: "Kevin D. Kissell" <kevink@paralogos.com>
Cc: Kaz Kylheku <KKylheku@zeugmasystems.com>, linux-mips@linux-mips.org
Subject: Re: Silly 100% CPU behavior on a SIG_IGN-ored SIGBUS.
Date: Thu, 25 Jun 2009 14:45:11 +0100 [thread overview]
Message-ID: <20090625134511.GC10661@linux-mips.org> (raw)
In-Reply-To: <20090625131300.GB10661@linux-mips.org>
On Thu, Jun 25, 2009 at 02:13:00PM +0100, Ralf Baechle wrote:
> >> int main(void)
> >> {
> >> int *deadbeef = (int *) 0xdeadbeef;
> >> signal(SIGBUS, SIG_IGN);
> >> printf("*deadbeef == %d\n", *deadbeef);
> >> return 0;
> >> }
> >>
> >> If any fatal exception is ignored, the program should be killed
> >> if that exception happens. 100% CPU is not a useful response.
> >>
> > It's not a useful program, so what did you expect? One might argue
> > that it would be more useful or correct to have the kernel advance the
> > PC to not endlessly repeat the doomed load, but ignoring SIG_IGN and
> > silently killing the thread violates the signal API as I've always
> > understood it.
>
> It's not a useful program but valid as a test case. However I agree with
> your interpretation of signal semantics but I'll have to round up a copy
> of the relevant standard documents; I have vague memories about some small
> print for cases like this.
I found this in IRIX 6.5 documentation:
Caution: Signals raised by the instruction stream, SIGILL, SIGEMT, SIGBUS,
and SIGSEGV, will cause infinite loops if their handler returns,
or the action is set to SIG_IGN.
Ralf
next prev parent reply other threads:[~2009-06-25 13:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-23 21:45 Silly 100% CPU behavior on a SIG_IGN-ored SIGBUS Kaz Kylheku
2009-06-23 21:45 ` Kaz Kylheku
2009-06-23 22:03 ` David Daney
2009-06-25 3:39 ` Kaz Kylheku
2009-06-25 3:39 ` Kaz Kylheku
2009-06-23 22:44 ` Kevin D. Kissell
2009-06-25 13:13 ` Ralf Baechle
2009-06-25 13:45 ` Ralf Baechle [this message]
2009-06-25 16:00 ` Kaz Kylheku
2009-06-25 16:00 ` Kaz Kylheku
2009-06-26 0:45 ` Ralf Baechle
2009-06-26 0:52 ` David Daney
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=20090625134511.GC10661@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=KKylheku@zeugmasystems.com \
--cc=kevink@paralogos.com \
--cc=linux-mips@linux-mips.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;
as well as URLs for NNTP newsgroup(s).