From: | "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com> |
---|---|
To: | "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [GENERAL] division by zero |
Date: | 2003-03-10 18:19:19 |
Message-ID: | 303E00EBDD07B943924382E153890E5433F7EF@cuthbert.rcsinc.local |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Bruce Momjian wrote:
>
>
> The big question is how to fix this on Win32. Is a test in the
integer
> division routines enough?
All divisions could be tested and the appropriate signal could get
raised by the handler. I would hate to see what this would do to the
source. In windows you can raise your own signals and we could probably
kludge it out that way.
> Is there a signal to catch on Win32?
There is not: in windows we use __try/__except in C and try/catch in
C++. This is a vendor implementation but works in both borland and
microsoft compilers. No idea elsewhere.
Here are the signals you do get: <quote>
SIGABRT
Abnormal termination. The default action terminates the calling program
with exit code 3.
SIGFPE
Floating-point error, such as overflow, division by zero, or invalid
operation. The default action terminates the calling program.
SIGILL
Illegal instruction. The default action terminates the calling program.
SIGINT
CTRL+C interrupt. The default action issues INT 23H.
SIGSEGV
Illegal storage access. The default action terminates the calling
program.
SIGTERM
Termination request sent to the program. The default action terminates
the calling program
</endquote>
Ideally, the exception could be caught and transferred to the
appropriate handler. Its really hard to say how this would interact
with the postgres exception handler without a thorough investigation.
I would only perform a test following each divide as a last resort.
Merlin
From | Date | Subject | |
---|---|---|---|
Next Message | Justin Clift | 2003-03-10 18:33:34 | Re: Who puts the Windows binaries on the FTP server? |
Previous Message | Tom Lane | 2003-03-10 17:23:33 | Re: Backends created by ODBC live forever ... |