Tom Lane wrote:
> 
> I checked into this, and indeed OS X 10.2 is behaving funny: integer
> divide by zero doesn't raise any signal, it just returns a bogus
answer.
> They're within their rights to do so according to the ANSI C spec
> (wherein division by zero is stated to have undefined behavior).
> But since other BSD-derived Unixen all seem to raise SIGFPE, I can't
> help wondering if this shouldn't be considered a bug.

FWIW, this also is a problem with some of the windows ports.  For
example, 'select 0/0' is unpredictable and can cause the server to gpf
and restart.  This does not include the SRA port, because I don't have
it.

Merlin

Sat, 8 Mar 2003 13:31:00 -0500
"Merlin Moncure" <merlin.moncure@rcsonline.com>
Re: [GENERAL] division by zero 
Merlin Moncure wrote:
> Tom Lane wrote:
> > 
> > I checked into this, and indeed OS X 10.2 is behaving funny: integer
> > divide by zero doesn't raise any signal, it just returns a bogus
> answer.
> > They're within their rights to do so according to the ANSI C spec
> > (wherein division by zero is stated to have undefined behavior).
> > But since other BSD-derived Unixen all seem to raise SIGFPE, I can't
> > help wondering if this shouldn't be considered a bug.
> 
> FWIW, this also is a problem with some of the windows ports.  For
> example, 'select 0/0' is unpredictable and can cause the server to gpf
> and restart.  This does not include the SRA port, because I don't have
> it.

I just tested the SRA Win32 threaded port and both SELECT 1/0 and SELECT
0/0 crash the process.  I have reported this to Tatsuo.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Mon, 10 Mar 2003 11:03:06 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [GENERAL] division by zero
Bruce Momjian wrote:
<snip>
>>FWIW, this also is a problem with some of the windows ports.  For
>>example, 'select 0/0' is unpredictable and can cause the server to gpf
>>and restart.  This does not include the SRA port, because I don't have
>>it.
> 
> I just tested the SRA Win32 threaded port and both SELECT 1/0 and SELECT
> 0/0 crash the process.  I have reported this to Tatsuo.

Reported the issue to the Apple guys earlier on today, but haven't heard 
anything back from them yet.

Guess we'll have to wait a few days to find out where things are at in 
regards to MacOS X.

Regards and best wishes,

Justin Clift

-- 
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi


Tue, 11 Mar 2003 02:58:48 +1030
Justin Clift <justin@postgresql.org>
Re: [GENERAL] division by zero