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
using a Freepascal 64bit UDF causes the engine to exit on client disconnect [CORE3651] #4002
Comments
Commented by: Robert Gilland (robert.gilland_basx.com.au) Thanks Frank for raising this one |
Modified by: @AlexPeshkoffassignee: Alexander Peshkov [ alexpeshkoff ] |
Modified by: @AlexPeshkoff |
Commented by: @AlexPeshkoff I can not reproduce this bug. I use ubuntu 11.04 with the following key components: And when running isql I have no problems with network server exits: STR_SAMEtest2 SQL> quit; |
Commented by: Frank Schlottmann-Goedde (fsg) Here I have root@fsg-ThinkPad-E520:~# /opt/fb25cs/bin/fb_smp_server & STR_SAMEtest SQL> exit; I will try fpc 2.4 next. |
Commented by: @AlexPeshkoff Frank, please try my binary. This time I've tested it on gentoo OS - and once again no problems. But when I try on this box with binary from 3651, server really exits. If my binary will work for you - I suggest to treat it as pascal, not firebird, problem. |
Modified by: @AlexPeshkoffAttachment: libtest64.so.bz2 [ 12092 ] |
Commented by: Frank Schlottmann-Goedde (fsg) Your binary works as expected, so this seems to be an issue with Freepascal 2.4.4 and this bug can be considered closed. |
Commented by: @AlexPeshkoff This bug is not reproduced when using older versions of fpc. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Frank Schlottmann-Goedde (fsg)
Is related to CORE3649
Attachments:
libtest64.so.bz2
Votes: 2
create a simple freepascal udf:
library test64;
uses
strings;
procedure str_same(instring,outstring:pchar);cdecl;export;
begin
strcopy(outstring,instring); {return instring}
end;
exports
str_same name 'str_same';
begin
end.
declare it to the engine:
DECLARE EXTERNAL FUNCTION STR_SAME
cstring(256), cstring(256)
RETURNS parameter 2
ENTRY_POINT 'str_same'
MODULE_NAME 'test64';
use it:
fsg@fsg-ThinkPad-E520:~/src/fpc/fsg_udf$ isql -user sysdba -password masterke localhost:/opt/ibdata/employee.fdb
Database: localhost:/opt/ibdata/employee.fdb, User: sysdba
SQL> select str_same('test2') from rdb$database;
STR_SAME
test2
SQL> quit;
fsg@fsg-ThinkPad-E520:~/src/fpc/fsg_udf$
strace will report:
root@fsg-ThinkPad-E520:~# strace -p 5102
Process 5102 attached - interrupt to quit
restart_syscall(<... resuming interrupted call ...>) = 1
poll([{fd=0, events=POLLIN}], 1, -1) = 1 ([{fd=0, revents=POLLIN}])
recvfrom(0, "\0\0\0\37\0\0\0\2", 8192, 0, NULL, NULL) = 8
clone(child_stack=0x7fdb35e1bf90, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7fdb35e1c9d0, tls=0x7fdb35e1c700, child_tidptr=0x7fdb35e1c9d0) = 5113
futex(0x7fdb37d1ac48, FUTEX_WAKE_PRIVATE, 1) = 1
poll([{fd=0, events=POLLIN}], 1, 60000) = 1 ([{fd=0, revents=POLLIN}])
poll([{fd=0, events=POLLIN}], 1, -1) = 1 ([{fd=0, revents=POLLIN}])
recvfrom(0, "\0\0\0\37\0\0\0\1", 8192, 0, NULL, NULL) = 8
futex(0x7fdb35e1bd80, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7fdb37d1abe0, FUTEX_WAKE_PRIVATE, 1) = 1
poll([{fd=0, events=POLLIN}], 1, 60000) = 1 ([{fd=0, revents=POLLIN}])
poll([{fd=0, events=POLLIN}], 1, -1) = 1 ([{fd=0, revents=POLLIN}])
recvfrom(0, "\0\0\0C\0\0\0\3\0\0\0\2\0\0\0\25\0\0\0\0", 8192, 0, NULL, NULL) = 20
poll([{fd=0, events=POLLIN}], 1, 60000PANIC: attached pid 5102 exited with 0
<unfinished ... exit status 0>
The text was updated successfully, but these errors were encountered: