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
Access violation on UDF crashes server [CORE5234] #5513
Comments
Commented by: @livius2 It looks like support question... but maybe i am wrong - then someone corrects me |
Commented by: Beto Neto (betoneto.tbo) Karol, the case is that it works on 2.x versions. This broked the compatibility. |
Modified by: @hvladassignee: Vlad Khorsun [ hvlad ] |
Commented by: @hvlad Beto Neto, please check next snapshot build. |
Commented by: @hvlad Karol, when UDF declare output parameter as RETURNS PARAMETER N - engine allocates memory itself. |
Modified by: @hvladstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0.1 [ 10730 ] Fix Version: 4.0 Alpha 1 [ 10731 ] |
Commented by: Beto Neto (betoneto.tbo) Fixed, thanks! Tested with Firebird-3.0.1.32524-0_Win32 |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Cannot be tested |
Commented by: @kattunga I have exactly the same problem here but it is not fixed in latest snapshot build. Now it works. The problem is fixed for me but it sounds that some kind of compatibility was broken. |
Commented by: @hvlad Christian, with no details we can't even diagnose an issue. Message in firebird.log say nothing about reasons, just a fact of AV cacthed at UDF call. |
Commented by: @kattunga Hi Vlad, I think that the problem is with FreePascal, not with Firebird, I remember that I had this issue several times in the past years, it appears and disappears depending on the combination of Freepascal and Firebird versions. Now with Firebird 3.0 Superserver, If I compile with FreePascal 2.6.4, I can reproduce the issue with an udf so simple like: function KPosInList(Str1, Str2: PChar): integer; cdecl; try
except it works fine for small resultsets, but on large resultsets it always raise: the user defined function: K_POSINLIST The problem disappear after compiling it with FreePascal 3.0. The question is: is posible to avoid the Firebird Server crash and only return an error to the connection that execute the query? Regards |
Commented by: Vadim Mescheryakov (vadimmescheryakov) I catched this error on Firebird 3.0.1.32609 / 64 bit (Windows) But error do not ever when call udf function SRV-DELFIN Mon Oct 31 13:51:58 2016 SRV-DELFIN Mon Oct 31 13:51:58 2016 SRV-DELFIN Mon Oct 31 13:51:58 2016 |
Commented by: @hvlad Vadim, firebird.log is clear - all AV's was catched when UDF's called Also, it is important to know - what compiler was used to build UDF |
Commented by: Beto Neto (betoneto.tbo) Now I'm getting this error on Firebird LI-V2.5.8.27089 This is the firebird.log dba301515fae Tue Apr 17 08:36:11 2018 dba301515fae (Client) Tue Apr 17 08:36:12 2018 dba301515fae (Client) Tue Apr 17 08:36:12 2018 And this is the UDF source (lazarus/free pascal) function udf_Trim(Str: PChar): PChar; cdecl; export; This crash occurrs randomly. |
Modified by: Beto Neto (betoneto.tbo)Version: 2.5.8 [ 10809 ] |
Modified by: Beto Neto (betoneto.tbo)priority: Blocker [ 1 ] => Critical [ 2 ] |
Commented by: @hvlad The log message is clear, isn't is ? What is value of BugcheckAbort setting ? Does UDF have IsMultythreaded := true ? And, please, don't put all and every issues related with AV in UDF into this ticket. |
Commented by: Beto Neto (betoneto.tbo) The log message is clear, isn't is ? What is value of BugcheckAbort setting ? Does UDF have IsMultythreaded := true ? Or its FPC equivalent. And, please, don't put all and every issues related with AV in UDF into this ticket. |
Commented by: @hvlad > The log message is clear, isn't is ? > What is value of BugcheckAbort setting ? > Does UDF have IsMultythreaded := true ? Please, next time ask at fb-support list first, until you 100% sure there is a bug. |
Submitted by: Beto Neto (betoneto.tbo)
I have a UDF named jjwudf. Inside it we have this exported function:
And this is its DDL
It returns a string of the char repeated, see a usage example:
When I use it on 2.x Firebird Servers, it works! But on Firebird 3.0 it crashes the server.
firebird.log
myvm Mon May 09 11:33:01 2016
The user defined function: UDF_STROFCHAR
referencing entrypoint: udf_StrOfChr
in module: jjwudf
caused the fatal exception: Access violation.
The code attempted to access a virtual
address without privilege to do so.
This exception will cause the Firebird server
to terminate abnormally.
Commits: db6debb 0db5c2d
The text was updated successfully, but these errors were encountered: