Subject | Re: [firebird-support] UDF and Linux, Need help.... |
---|---|
Author | Ivan Prenosil |
Post date | 2004-02-12T13:06:28Z |
How are you allocating and releasing memory for return values of your UDFs ?
You shoud use ib_util_malloc() function (from ib_util library),
and free it using FREE_IT keyword in UDF declaration:
You shoud use ib_util_malloc() function (from ib_util library),
and free it using FREE_IT keyword in UDF declaration:
> DECLARE EXTERNAL FUNCTION KIDFROMINTIvan
> INTEGER,
> RETURNS CSTRING(25) FREE_IT
> ENTRY_POINT 'kidfromint' MODULE_NAME 'flexisoftudf'
----- Original Message -----
From: "Trond" <trodamm@...>
To: <firebird-support@yahoogroups.com>
Sent: Thursday, February 12, 2004 12:39 PM
Subject: [firebird-support] UDF and Linux, Need help....
> I have some selfmade UDF's that is working fine on a Windows server (XP,
> FB1.5 RC4-RC9).
> The UDF's is written in Delphi(on Windows) and Kylix(on Linux).
> As soon as i move the database to Linux (RedHat 9.x, FB 1.5 CC RC8), the
> server dies instantly (connection is broken)when calling the UDF. No entry
> in
> Firebird.log. The same thing happens either the call is coming from my
> application or from ISQL. HOWEVER If I connect thru IBexpert, and run the
> SQL from
> the SQL Editor it works fine!!.
> What is going on ? I have no real experience with UDF's and Linux, so this
> might be trivial, but I really need some help on this.
>
> The UDF's are typically decleared like this:
>
> function kidfromint(var V1, prefix,lengde : integer) : PAnsichar; cdecl;
> export;
> ...
>
>
> function kidfromstr(V1 : PAnsichar ; var prefix,lengde : integer) :
> PAnsichar; cdecl; export;
> ...
>
> DECLARE EXTERNAL FUNCTION KIDFROMINT
> INTEGER,
> INTEGER,
> INTEGER
> RETURNS CSTRING(25)
> ENTRY_POINT 'kidfromint' MODULE_NAME 'flexisoftudf'
>
> DECLARE EXTERNAL FUNCTION KIDFROMSTR
> CSTRING(25),
> INTEGER,
> INTEGER
> RETURNS CSTRING(25)
> ENTRY_POINT 'kidfromstr' MODULE_NAME 'flexisoftudf'