linux-mips
[Top] [All Lists]

Silly 100% CPU behavior on a SIG_IGN-ored SIGBUS.

To: <linux-mips@linux-mips.org>
Subject: Silly 100% CPU behavior on a SIG_IGN-ored SIGBUS.
From: "Kaz Kylheku" <KKylheku@zeugmasystems.com>
Date: Tue, 23 Jun 2009 14:45:34 -0700
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Thread-index: Acn0S/AngQEbMFvsSP2syEgQxDuZUA==
Thread-topic: Silly 100% CPU behavior on a SIG_IGN-ored SIGBUS.
Hi all,

On kernel 2.6.26, glibc 2.5 (n32), SiByte SB-1 core, the following
program goes into 100% CPU, chewing up about 80% kernel time and
20% user.

#include <stdio.h>
#include <signal.h>

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.

(If there is a handler, and that handler returns without doing anything
to
prevent a recurrence of the exception when the instruction is re-tried,
that's different).

<Prev in Thread] Current Thread [Next in Thread>