Subject: Re: signal(SIGSEGV, SIG_IGN) -> 100% CPU
To: Darren Reed <darrenr@reed.wattle.id.au>
From: Chris G. Demetriou <cgd@netbsd.org>
List: tech-kern
Date: 06/09/1999 21:15:24
Darren Reed <darrenr@reed.wattle.id.au> writes:

> When using signal(SIGSEGV, SIG_IGN), should one expect CPU usage to
> sky rocket to ~100% of that process ?  I posted earlier re. pipe(2)
> causing a segmentation fault rather than returning EFAULT, HOWEVER,
> I attempted to bypass this with ignoring SEGV, except that has not
> worked as planned.  If this is a bug somewhere, I'll file a PR.  If
> not, it seems pretty damn stupid.  FWIW, this is being tested on a
> SHARK.  Test program below.

As mentioned elsewhere, this is not a bug.

you have effectively written a complex while(1) ; loop, or, probably
closer, a whlie(1) getpid(); loop.

I wouldn't except the process to prevent other processes from running,
or otherwise 'lock up' the system.  if you're seeing that, you've got
a bug.


cgd
-- 
Chris Demetriou - cgd@netbsd.org - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.