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
Server crash when libfbclient used in UDF [CORE2219] #2647
Comments
Modified by: b0bik (b0bik)priority: Minor [ 4 ] => Critical [ 2 ] |
Modified by: b0bik (b0bik)Version: 2.1.1 [ 10223 ] description: Call to isc_decode_timestamp in UDF declared as: procedure isc_decode_timestamp(ib_date : PISC_TIMESTAMP; tm_date : PTM); cdecl; external 'fbclient'; cause fbserver to terminate. Firebrid.log: /opt/fb21ss/bin/fbguard: /opt/fb21ss/bin/fbserver terminated abnormally (-1) The same happen on 2.1.1, 2.1.2, 2.1.2-debug => Call to isc_decode_timestamp in UDF declared as: procedure isc_decode_timestamp(ib_date : PISC_TIMESTAMP; tm_date : PTM); cdecl; external 'fbclient'; causes fbserver to terminate. Firebrid.log: /opt/fb21ss/bin/fbguard: /opt/fb21ss/bin/fbserver terminated abnormally (-1) The same happens on 2.1.1, 2.1.2, 2.1.2-debug Version: 2.1.2 [ 10270 ] => |
Commented by: @dyemanov As you have a debug version, it's worth setting up your system to generate the core dumps and posting here the stack trace. |
Commented by: b0bik (b0bik) Hello Once again. After removing all fb* stuff from both machines (Windows and Linux) I downloaded two archives: Firebird-2.1.1.17910-0_Win32.zip - for Windows and After "instalation" I did following things: 1. aliases.conf - new line pointing to my fdb file I created two version of library test. For Windows - Turbo Delphi, for Linux - Free Pascal Compiler: test.dpr: library test; uses funcs in 'funcs.pas'; exports ftest; begin funcs.pas: unit funcs; interface uses Types; type TM = record ISC_TIMESTAMP = record PTM = ^TM; procedure isc_decode_timestamp(ib_date: PISC_TIMESTAMP; tm_date: PTM); cdecl; external 'fbclient'; function ftest(aDateTime : PISC_TIMESTAMP): Integer; cdecl; implementation function ftest(aDateTime: PISC_TIMESTAMP): Integer; cdecl; end. The only one difference between Windows and Linux is calling convention to fbclient (Windows stdcall, Linux cdecl). After building library I copied it into UDF directory (/opt/firebird/UDF/, c:\program files\firebird_211\UDF) I declared external function using: DECLARE EXTERNAL FUNCTION FTEST After committing, I connected to my database using isql utility and run a query: select ftest(current_timestamp) from rdb$database Windows: FTEST
Linux - nothing, query execution never ends. But neither fbserver nor fbguard process takes lot of CPU time. When I connect to Linux machine from Windows (using flamerobin) and execute the same query, flame writes: "Starting transaction ..." and nothing happens too. When I comment line marked with {*} in my udf everything works OK. Attached files: http://libtest.so - compiled version of my simple udf. |
Commented by: b0bik (b0bik) udf |
Modified by: b0bik (b0bik)Attachment: http://libtest.so [ 11232 ] |
Modified by: @dyemanovassignee: Alexander Peshkov [ alexpeshkoff ] |
Commented by: @AlexPeshkoff Your pascal declaration of struct tm does not match one used in C++ in linux: #ifdef __USE_BSD Therefore return address on the stack is overwritten. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: b0bik (b0bik)
Attachments:
libtest.so
Call to isc_decode_timestamp in UDF declared as:
procedure isc_decode_timestamp(ib_date : PISC_TIMESTAMP; tm_date : PTM); cdecl; external 'fbclient';
causes fbserver to terminate.
Firebrid.log:
/opt/fb21ss/bin/fbguard: /opt/fb21ss/bin/fbserver terminated abnormally (-1)
The same happens on 2.1.1, 2.1.2, 2.1.2-debug
(I have a 2.1.2 version from http://www.dqteam.com/fb2/)
The text was updated successfully, but these errors were encountered: