Subject: Re: Trivial program spins on divide by zero
To: Tim Goodwin <tjg@star.le.ac.uk>
From: Gavan Fantom <gavan@coolfactor.org>
List: current-users
Date: 08/13/2003 16:33:06
On Tue, 12 Aug 2003, Tim Goodwin wrote:

> I've been getting quite a few processes spinning (chewing up all
> available CPU) recently.  These processes will die with `kill -9', but
> do not respond to any other signal.  The problems started for me when
> I upgraged (full release) around 1.6U, and continue through 1.6W
> (kernel only updated) - before that, I wasn't very up to date anyway.
>
> The following 3 line program demonstrates the problem:
>
>     int main(void) {
>       int z = 1 / 0;
>     }

Out of curiosity, what happens if you do something like

int main(void) {
    for (;;) {
        sleep(1);
    }
}

and then send it a signal? Does it then start spinning?

-- 
Gillette - the best a man can forget