Re: [Firebird-devel] UDF lib works on Linux but crash on Windows (Error writing data to connection)

2019-05-06 Thread Massimo Fazzolari
> > Do you check returned value for nil? Yes, this Simple function is just one of a big set of UDFs that we exported in the same dll/so file. We have been using these functions in production for more than 10 years. I stumbled upon this issue when I tried to compile the same working code (without

Re: [Firebird-devel] UDF lib works on Linux but crash on Windows (Error writing data to connection)

2019-05-06 Thread Dimitry Sibiryakov
06.05.2019 14:59, Massimo Fazzolari wrote: I use this udfmalloc, on windows is defined as: function udfmalloc(Size: Integer): Pointer; cdecl; external 'ib_util.dll' name 'ib_util_malloc'; Do you check returned value for nil? BTW, "Integer" is not always right declaration for the

Re: [Firebird-devel] UDF lib works on Linux but crash on Windows (Error writing data to connection)

2019-05-06 Thread Massimo Fazzolari
> > What is in firebird.log ? Nothing in the firebird.log How UDF is declared in DB ? DECLARE EXTERNAL FUNCTION SIMPLE CSTRING (254) RETURNS CSTRING (254) FREE_IT ENTRY_POINT 'Simple' MODULE_NAME 'SitaUdfLib.dll' How UDF is declared in Pascal ? function Simple(sz: PChar): PChar;

Re: [Firebird-devel] UDF lib works on Linux but crash on Windows (Error writing data to connection)

2019-05-06 Thread Vlad Khorsun
06.05.2019 10:48, Massimo Fazzolari wrote: Hello, I have an UDF lib compiled with FPC 3.0.4 (Lazarus 2.0.2) that works properly on linux (Ubuntu 18.04 and Firebird 2.5.8.27089) but Firebird crashes on Windows with this error everytime I invoke any of the user defined functions: *Error

Re: [Firebird-devel] UDF lib works on Linux but crash on Windows (Error writing data to connection)

2019-05-06 Thread Dimitry Sibiryakov
06.05.2019 12:08, Massimo Fazzolari wrote: There is no code changes to my UDF source code between the version compiled with FPC 2.6.3 (which works on both linux and windows) and FPC 3.0.4 (which doesn't work on Windows, but works on Linux). Some bugs (such as wrong calling convention usage)

[Firebird-devel] UDF lib works on Linux but crash on Windows (Error writing data to connection)

2019-05-06 Thread Massimo Fazzolari
Hello, I have an UDF lib compiled with FPC 3.0.4 (Lazarus 2.0.2) that works properly on linux (Ubuntu 18.04 and Firebird 2.5.8.27089) but Firebird crashes on Windows with this error everytime I invoke any of the user defined functions: *Error writing data to connection* The same UDF library