-
-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinity from UDF should be trapped by the engine [CORE2582] #2992
Comments
Commented by: @dyemanov As far as I can see, the CRT function POW() used in that UDF simply doesn't throw any exception, so there's nothing to catch. |
Commented by: Claudio Valderrama C. (robocop) In this case, Infinity will have to be detected in fun.epp directly. |
Modified by: Claudio Valderrama C. (robocop)assignee: Claudio Valderrama C. [ robocop ] |
Commented by: Claudio Valderrama C. (robocop) Given these declarations: DECLARE EXTERNAL FUNCTION DPOWER DECLARE EXTERNAL FUNCTION XASIN DECLARE EXTERNAL FUNCTION XDIV the expected answer from the engine is: SQL> select dpower(1e120, 3) from rdb$database;
=======================
=======================
======================= |
Modified by: Claudio Valderrama C. (robocop)status: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 2.5 RC1 [ 10362 ] |
Commented by: @pcisar QA test added. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovQA Status: No test |
Modified by: @pavel-zotovQA Status: No test => Done successfully |
Submitted by: Claudio Valderrama C. (robocop)
Assigned to: Claudio Valderrama C. (robocop)
Is related to QA410
This is related to CORE2581 Infinity should not escape from the engine
In only tested FB2.5, but maybe FB2.1 behaves the same.
In Windows, there's a __try/__catch block around UDF execution to trap several special conditions. Normally the answer from these conditions is engine shutdown.
I think that in case of overflow, we don't need to panic. We simply need to convert it to an exception about FP overflow.
But I wonder why the protection block used by the Windows build is not working: it should invoke ISC_exception_post() in isc_sync.cpp.
SQL> declare external function dPower
CON> double precision by descriptor, double precision by descriptor,
CON> double precision by descriptor
CON> returns parameter 3
CON> entry_point 'power' module_name 'fbudf';
SQL> select dpower(10e+110, 3) from rdb$database;
=======================
Infinity
C.
Commits: 13a0547 b22b7dc FirebirdSQL/fbt-repository@aa5fc83
The text was updated successfully, but these errors were encountered: