Subject: Re: Division by zero doesn't raise SIGFPE
To: Min Sik Kim <minskim@bawi.org>
From: Martin Husemann <martin@duskware.de>
List: current-users
Date: 12/16/2003 08:18:39
On Mon, Dec 15, 2003 at 07:42:21PM -0600, Min Sik Kim wrote:
> A couple more programs that hang, in case they help.

I completely updated my i386 system overnight to -current from sources cvs
updated when this thread came up.

It still works for me, and ...

> ================================
> #include <stdlib.h>
> #include <signal.h>
> #include <unistd.h>
> 
> static volatile int handler_done = 0;
> 
> void handler(int sig)
> {
>     handler_done = 1;
>     return;
> }
> 
> int main(int argc, char *argv[])
> {
>   signal(SIGUSR1, handler);
>   kill(getpid(), SIGUSR1);
>   while (!handler_done)
>     /*nop*/;
>   exit(0);
> }
> ================================

Cleanly exits imediately

> ================================
> #include <termcap.h>
> 
> main()
> {
>     int r = tgetent((char*)0, "vt100");
>     return r;
> }
> ================================

Dies with segmentation fault and dumps core.

Martin