Closed timon closed 3 years ago
I have managed to obtain a stack trace from gdb, if it helps:
#0 0x00007ffff080b7dd in kpudsany () from /usr/lib/oracle/12.1/client64/lib/libclntsh.so.12.1 #1 0x00007ffff07c6628 in OCIDescribeAny () from /usr/lib/oracle/12.1/client64/lib/libclntsh.so.12.1 #2 0x00007ffff327bb5a in oci8_OCIDescribeAny_cb (user_data=0x7fffffffaa30) at apiwrap.c:1518
#3 0x00005555556e7f82 in call_without_gvl (fail_if_interrupted=0, data2=, ubf= , data1=0x7fffffffaa30, func=0x7ffff327bb30 ) at thread.c:1301 #4 rb_thread_call_without_gvl (func=0x7ffff327bb30 , data1=0x7fffffffaa30, ubf=ubf@entry=0x7ffff3263300 , data2= ) at thread.c:1411 #5 0x00007ffff32633ee in protected_call (data=data@entry=140737488333232) at oci8lib.c:406 #6 0x000055555557d109 in rb_protect (proc=proc@entry=0x7ffff32633b0 , data=data@entry=140737488333232, state=state@entry=0x7fffffffa9ac) at eval.c:907 #7 0x00007ffff3264177 in oci8_call_without_gvl (svcctx=svcctx@entry=0x5555574b0090, func=func@entry=0x7ffff327bb30 , data=data@entry=0x7fffffffaa30) at oci8lib.c:463 #8 0x00007ffff327c19a in oci8_OCIDescribeAny_nb (svcctx=svcctx@entry=0x5555574b0090, svchp= , errhp= , objptr=objptr@entry=0x55555751ab60, objnm_len=objnm_len@entry=45, objptr_typ= , info_level=0 '\000', objtyp=0 '\000', dschp=0x5555574cef20, file=0x7ffff32803c3 "metadata.c", line=175) at apiwrap.c:1541 #9 0x00007ffff326b963 in oci8_do_describe (self=self@entry=93825025032320, objptr=objptr@entry=0x55555751ab60, objlen=objlen@entry=45, objtype=objtype@entry=1 '\001', klass=klass@entry=93825013381840, check_public=check_public@entry=20) at metadata.c:173 #10 0x00007ffff326bc82 in oci8_describe (self=93825025032320, name= , klass=93825013381840, check_public=20) at metadata.c:214 #11 0x00005555556c056d in vm_call_cfunc_with_frame (ci= , cc= , calling= , reg_cfp=0x7ffff70dba90, th=0x555555a555e0) at vm_insnhelper.c:1642 #12 vm_call_cfunc (th=0x555555a555e0, reg_cfp=0x7ffff70dba90, calling= , ci= , cc= ) at vm_insnhelper.c:1737 #13 0x00005555556cd4f3 in vm_call_method (th=0x555555a555e0, cfp=0x7ffff70dba90, calling= , ci= , cc= ) at vm_insnhelper.c:2177 #14 0x00005555556c6d89 in vm_exec_core (th=th@entry=0x555555a555e0, initial=initial@entry=0) at insns.def:994 #15 0x00005555556cbe0f in vm_exec (th=th@entry=0x555555a555e0) at vm.c:1693 #16 0x00005555556ccabd in invoke_block (block=0x7ffff70dbcf0, opt_pc= , type= , cref=0x0, self=93825002399720, iseq=0x5555566ff378, th=0x555555a555e0) at vm.c:921 #17 invoke_block_from_c_0 (th=0x555555a555e0, block=0x7ffff70dbcf0, self=93825002399720, argc= , argv= , blockptr= , cref=0x0, splattable=1) at vm.c:973 #18 0x00005555556d3f4c in invoke_block_from_c_splattable (cref=0x0, blockptr=0x0, argv=0x7fffffffb308, argc=1, self= , block= , th= ) at vm.c:990 #19 vm_yield (argc=1, argv=0x7fffffffb308, th= ) at vm.c:1025 #20 rb_yield_0 (argv=0x7fffffffb308, argc=1) at vm_eval.c:1013 #21 rb_yield_1 (val= ) at vm_eval.c:1019 #22 rb_yield (val= ) at vm_eval.c:1029 #23 0x00005555556f513c in rb_ary_each (ary=93825025035640) at array.c:1815 #24 0x00005555556c056d in vm_call_cfunc_with_frame (ci= , cc= , calling= , reg_cfp=0x7ffff70dbcd0, th=0x555555a555e0) at vm_insnhelper.c:1642 #25 vm_call_cfunc (th=0x555555a555e0, reg_cfp=0x7ffff70dbcd0, calling= , ci= , cc= ) at vm_insnhelper.c:1737 #26 0x00005555556cd4f3 in vm_call_method (th=0x555555a555e0, cfp=0x7ffff70dbcd0, calling= , ci= , cc= ) at vm_insnhelper.c:2177 #27 0x00005555556c6cb8 in vm_exec_core (th=th@entry=0x555555a555e0, initial=initial@entry=0) at insns.def:963 #28 0x00005555556cbe0f in vm_exec (th=th@entry=0x555555a555e0) at vm.c:1693 #29 0x00005555556d3e53 in invoke_block (block= , opt_pc= , type= , cref=0x0, self=93825002399720, iseq= , th= ) at vm.c:921 #30 invoke_block_from_c_0 (splattable=1, cref=0x0, blockptr=0x0, argv=0x0, argc=0, self=93825002399720, block= , th= ) at vm.c:973 #31 invoke_block_from_c_splattable (cref=0x0, blockptr=0x0, argv=0x0, argc=0, self=93825002399720, block= , th= ) at vm.c:990 #32 vm_yield (argc=0, argv=0x0, th= ) at vm.c:1025 #33 rb_yield_0 (argv=0x0, argc=0) at vm_eval.c:1013 #34 loop_i () at vm_eval.c:1090 #35 0x000055555557ce54 in rb_rescue2 (b_proc=0x5555556d3b40 , data1=0, r_proc=0x5555556bb430 , data2=0) at eval.c:839 #36 0x00005555556c056d in vm_call_cfunc_with_frame (ci= , cc= , calling= , reg_cfp=0x7ffff70dbd50, th=0x555555a555e0) at vm_insnhelper.c:1642 #37 vm_call_cfunc (th=0x555555a555e0, reg_cfp=0x7ffff70dbd50, calling= , ci= , cc= ) at vm_insnhelper.c:1737 #38 0x00005555556cd4f3 in vm_call_method (th=0x555555a555e0, cfp=0x7ffff70dbd50, calling= , ci= , cc= ) at vm_insnhelper.c:2177 #39 0x00005555556c6cb8 in vm_exec_core (th=th@entry=0x555555a555e0, initial=initial@entry=0) at insns.def:963 #40 0x00005555556cbe0f in vm_exec (th=th@entry=0x555555a555e0) at vm.c:1693 #41 0x00005555556ccabd in invoke_block (block=0x5555571a83d0, opt_pc= , type= , cref=0x0, self=93824997877240, iseq=0x555555f1e5f0, th=0x555555a555e0) at vm.c:921 #42 invoke_block_from_c_0 (th=0x555555a555e0, block=0x5555571a83d0, self=93824997877240, argc= , argv= , blockptr= , cref=0x0, splattable=0) at vm.c:973 #43 0x00005555556ccb93 in invoke_block_from_c_unsplattable (cref=0x0, blockptr=0x0, argv=0x7fffffffc550, argc=0, self=93824997877240, block=0x5555571a83d0, th=0x555555a555e0) at vm.c:998 #44 vm_invoke_proc (th=th@entry=0x555555a555e0, proc=proc@entry=0x5555571a83d0, self=93824997877240, argc=argc@entry=0, argv=0x7fffffffc550, blockptr=0x0) at vm.c:1046 #45 0x00005555556cce14 in rb_vm_invoke_proc (blockptr= , argv= , argc=0, proc=0x5555571a83d0, th=0x555555a555e0) at vm.c:1074 #46 vm_call_opt_call (th=0x555555a555e0, cfp=0x7ffff70dbe10, calling=0x7fffffffc6c0, ci= , cc= ) at vm_insnhelper.c:1868 #47 0x00005555556cd4f3 in vm_call_method (th=0x555555a555e0, cfp=0x7ffff70dbe10, calling= , ci= , cc= ) at vm_insnhelper.c:2177 #48 0x00005555556c6d89 in vm_exec_core (th=th@entry=0x555555a555e0, initial=initial@entry=0) at insns.def:994 #49 0x00005555556cbe0f in vm_exec (th=th@entry=0x555555a555e0) at vm.c:1693 #50 0x00005555556ccabd in invoke_block (block=0x5555571adba0, opt_pc= , type= , cref=0x0, self=93825021980760, iseq=0x5555560223c0, th=0x555555a555e0) at vm.c:921 #51 invoke_block_from_c_0 (th=0x555555a555e0, block=0x5555571adba0, self=93825021980760, argc= , argv= , blockptr= , cref=0x0, splattable=0) at vm.c:973 #52 0x00005555556ccb93 in invoke_block_from_c_unsplattable (cref=0x0, blockptr=0x0, argv=0x7fffffffce00, argc=0, self=93825021980760, block=0x5555571adba0, th=0x555555a555e0) at vm.c:998 #53 vm_invoke_proc (th=th@entry=0x555555a555e0, proc=proc@entry=0x5555571adba0, self=93825021980760, argc=argc@entry=0, argv=0x7fffffffce00, blockptr=0x0) at vm.c:1046 #54 0x00005555556cce14 in rb_vm_invoke_proc (blockptr= , argv= , argc=0, proc=0x5555571adba0, th=0x555555a555e0) at vm.c:1074 #55 vm_call_opt_call (th=0x555555a555e0, cfp=0x7ffff70dbe50, calling=0x7fffffffcf70, ci= , cc= ) at vm_insnhelper.c:1868 #56 0x00005555556cd4f3 in vm_call_method (th=0x555555a555e0, cfp=0x7ffff70dbe50, calling= , ci= , cc= ) at vm_insnhelper.c:2177 #57 0x00005555556c6d89 in vm_exec_core (th=th@entry=0x555555a555e0, initial=initial@entry=0) at insns.def:994 #58 0x00005555556cbe0f in vm_exec (th=th@entry=0x555555a555e0) at vm.c:1693 #59 0x00005555556ccabd in invoke_block (block=0x555556efec40, opt_pc= , type= , cref=0x0, self=93824997877240, iseq=0x555555f1e0c8, th=0x555555a555e0) at vm.c:921 #60 invoke_block_from_c_0 (th=0x555555a555e0, block=0x555556efec40, self=93824997877240, argc= , argv= , blockptr= , cref=0x0, splattable=0) at vm.c:973 #61 0x00005555556ccb93 in invoke_block_from_c_unsplattable (cref=0x0, blockptr=0x0, argv=0x7fffffffd6b0, argc=0, self=93824997877240, block=0x555556efec40, th=0x555555a555e0) at vm.c:998 #62 vm_invoke_proc (th=th@entry=0x555555a555e0, proc=proc@entry=0x555556efec40, self=93824997877240, argc=argc@entry=0, argv=0x7fffffffd6b0, blockptr=0x0) at vm.c:1046 #63 0x00005555556cce14 in rb_vm_invoke_proc (blockptr= , argv= , argc=0, proc=0x555556efec40, th=0x555555a555e0) at vm.c:1074 #64 vm_call_opt_call (th=0x555555a555e0, cfp=0x7ffff70dbf50, calling=0x7fffffffd820, ci= , cc= ) at vm_insnhelper.c:1868 #65 0x00005555556cd4f3 in vm_call_method (th=0x555555a555e0, cfp=0x7ffff70dbf50, calling= , ci= , cc= ) at vm_insnhelper.c:2177 #66 0x00005555556c6d89 in vm_exec_core (th=th@entry=0x555555a555e0, initial=initial@entry=0) at insns.def:994 #67 0x00005555556cbe0f in vm_exec (th=0x555555a555e0) at vm.c:1693 #68 0x00005555556d4f43 in rb_iseq_eval_main (iseq=iseq@entry=0x555555f1ecd0) at vm.c:1936 #69 0x00005555555787da in ruby_exec_internal (n=0x555555f1ecd0) at eval.c:245 #70 0x000055555557c43f in ruby_exec_node (n= ) at eval.c:310 #71 ruby_run_node (n= ) at eval.c:302 #72 0x00005555555783ab in main (argc= , argv= ) at main.c:36
@timon Could you post more detailed information to reproduce the issue?
I created a package function as follows,
-- connect / as sysdba
create user user1 identified by user1 default tablespace users temporary tablespace temp;
create or replace package user1.test_pkg
as
procedure test_proc;
end;
/
create or replace package body user1.test_pkg
as
procedure test_proc is
begin
null;
end;
end;
/
and executed the following script.
require 'oci8'
conn = OCI8.new('username/password')
p conn.describe_any('TEST_PKG.TEST_PROC')
It didn't stop with SIGSEGV but raised ORA-04043: object TEST_PKG.TEST_PROC does not exist (OCIError)
.
After grant execute on user1.test_pkg to public
was executed, it raises no errors.
My environment:
@kubo In cooperation with our DBA, I have managed to reproduce the issue by removing the callable object definition from package declaration. SIGSEGV is also generated when calling describe_any
on an invalid identifier within existing package.
P.S. My colleague who was creating the package told me he fixed the issue by providing the grants necessary, but I have no means to verify if those were grants of if he fixed the package declaration.
@timon Could you try test218.c in https://gist.github.com/kubo/b7ddbe5a0a76629ca3bd08cd2eb862af. I guess that this is an issue in Oracle client.
$ wget https://gist.githubusercontent.com/kubo/b7ddbe5a0a76629ca3bd08cd2eb862af/raw/762bce3435953a286989c31ace569a1681f1984b/test218.c
$ vi test218.c # change username, password, database and object_name
$ IC_DIR=/opt/oracle/instantclient # Set instant client directory
$ gcc -o test218 test218.c -I$IC_DIR/sdk/include -L$IC_DIR -Wl,-rpath,$IC_DIR -lclntsh
$ ./test218
If the program stops with SIGSEGV, could you report it to the Oracle support?
closed due to inactivity
Hello and thank you for your gem.
I have found that calling
describe_any
on object without sufficient permissions results in process termination with SEGFAULT below. The object being described is a stored procedure within pl/sql package.I'm running
UPD: clarified that the describe is a stored procedure within a package and also noted that Oracle Client 18.3 is also affected