Subject: Re: Division by zero doesn't raise SIGFPE
To: Min Sik Kim <minskim@bawi.org>
From: Steven M. Bellovin <smb@research.att.com>
List: current-users
Date: 12/16/2003 13:16:10
In message <20031216120329.4e08baa7.minskim@bawi.org>, Min Sik Kim writes:
>On Tue, 16 Dec 2003 10:17:52 -0600
>Min Sik Kim <minskim@bawi.org> wrote:
>
>> On Tue, 16 Dec 2003 08:18:39 +0100
>> Martin Husemann <martin@duskware.de> wrote:
>> 
>> > 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.
>> 
>> Thanks for testing them.  I also have another machine with 1.6ZF,
>> where I got the same results as yours.
>
>A bit more info and correction.  It happens only when I work under
>GNOME-2.4 environment.  If I use twm, no such problem.  It's also fine
>when I remotely connect to the machine, even if gnome-session is
>running.  The machine with 1.6ZF has exactly the same problem.
>

That suggests that you should check the setting of signals under gnome 
-- remember that ignoring a signal is inherited by child processes.  
Also test using batch or cron, or when not running in X.

		--Steve Bellovin, http://www.research.att.com/~smb