You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UDF code (compiled to gonet_udf.dll in Borland Delphi 5):
function UPROSCNIP(aNip: PChar): PChar; cdecl;
var lS: string;
begin
lS := aNip;
lS := StringReplace(lS, '-','', [rfReplaceAll, rfIgnoreCase]);
lS := StringReplace(lS, ' ','', [rfReplaceAll, rfIgnoreCase]);
if UpperCase(copy(lS, 1, 2)) = 'PL' then
lS := copy(lS, 3, length(ls));
Result :=ib_util_malloc(length(lS)+1);
StrPCopy(Result, lS);
end{};
This UDF is used in TRIGGERS to fill one field from another:
CREATE TRIGGER KONTRAHENT_BI FOR KONTRAHENT ACTIVEBEFORE INSERT POSITION 0
AS
BEGIN
NEW.PROSTYNIP = FN_UPROSCNIP(NEW.NIP);
END
CREATE TRIGGER KONTRAHENT_BU FOR KONTRAHENT ACTIVEBEFORE UPDATE POSITION 0
AS
BEGIN
NEW.PROSTYNIP = FN_UPROSCNIP(NEW.NIP);
END
Field PROSTYNIP and NIP has a VARCHAR(20) type.
Sometimes (but not always) during simple update or insert server crashes with message (firebird.log):
BOGDAN (Server) Fri May 23 10:38:14 2008
The user defined function: FN_UPROSCNIP
referencing entrypoint: UPROSCNIP
in module: gonet_udf
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.
BOGDAN (Server) Fri May 23 10:38:14 2008
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.
The same situation occurs on two different machines. I can't precisely define situation wchich in 100% causes this problem. UDF works perfectly 90%, but sometimes during update or insert server crashes.
The text was updated successfully, but these errors were encountered:
Submitted by: b0bik (b0bik)
UDF code (compiled to gonet_udf.dll in Borland Delphi 5):
function UPROSCNIP(aNip: PChar): PChar; cdecl;
var lS: string;
begin
lS := aNip;
lS := StringReplace(lS, '-','', [rfReplaceAll, rfIgnoreCase]);
lS := StringReplace(lS, ' ','', [rfReplaceAll, rfIgnoreCase]);
if UpperCase(copy(lS, 1, 2)) = 'PL' then
lS := copy(lS, 3, length(ls));
Result :=ib_util_malloc(length(lS)+1);
StrPCopy(Result, lS);
end{};
Declaration:
DECLARE EXTERNAL FUNCTION FN_UPROSCNIP
CSTRING(64)
RETURNS CSTRING(64) FREE_IT
ENTRY_POINT 'UPROSCNIP' MODULE_NAME 'gonet_udf'
This UDF is used in TRIGGERS to fill one field from another:
CREATE TRIGGER KONTRAHENT_BI FOR KONTRAHENT ACTIVEBEFORE INSERT POSITION 0
AS
BEGIN
NEW.PROSTYNIP = FN_UPROSCNIP(NEW.NIP);
END
CREATE TRIGGER KONTRAHENT_BU FOR KONTRAHENT ACTIVEBEFORE UPDATE POSITION 0
AS
BEGIN
NEW.PROSTYNIP = FN_UPROSCNIP(NEW.NIP);
END
Field PROSTYNIP and NIP has a VARCHAR(20) type.
Sometimes (but not always) during simple update or insert server crashes with message (firebird.log):
BOGDAN (Server) Fri May 23 10:38:14 2008
The user defined function: FN_UPROSCNIP
referencing entrypoint: UPROSCNIP
in module: gonet_udf
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.
BOGDAN (Server) Fri May 23 10:38:14 2008
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.
BOGDAN (Client) Fri May 23 10:38:14 2008
C:\Program Files\Firebird_15\bin\fbserver.exe: terminated abnormally (4294967295)
BOGDAN (Client) Fri May 23 10:38:15 2008
Guardian starting: C:\Program Files\Firebird_15\bin\fbserver.exe
I also noticed this on FB 1.5.2.
The same situation occurs on two different machines. I can't precisely define situation wchich in 100% causes this problem. UDF works perfectly 90%, but sometimes during update or insert server crashes.
The text was updated successfully, but these errors were encountered: