[MDEV-10991] Server crashes in spider_udf_direct_sql_create_conn - tests in spider/oracle* suites crash the server Created: 2016-10-09  Updated: 2018-05-09  Resolved: 2018-03-19

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Spider
Affects Version/s: 10.0, 10.1, 10.2
Fix Version/s: 10.1.32, 10.2.14

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Jacob Mathew (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Sprint: 2017-02, 10.1.22, 10.1.32

 Description   

perl ./mtr spider/oracle.spider3_fixes

Stack trace from 10.0 b34d7fba31

#6  0x0000008e0000008d in ?? ()
#7  0x00007ff3bed4891b in spider_udf_direct_sql_create_conn (direct_sql=0x7ff3bd948380, error_num=0x7ff3c7b2ff5c) at /data/src/10.0/storage/spider/spd_direct_sql.cc:517
#8  0x00007ff3bed48da3 in spider_udf_direct_sql_get_conn (direct_sql=0x7ff3bd948380, trx=0x7ff3bd981080, error_num=0x7ff3c7b2ff5c) at /data/src/10.0/storage/spider/spd_direct_sql.cc:690
#9  0x00007ff3bed4e819 in spider_direct_sql_body (initid=0x7ff3bd822730, args=0x7ff3bd8226f0, is_null=0x7ff3bd822761 "", error=0x7ff3bd822760 "", bg=0 '\000') at /data/src/10.0/storage/spider/spd_direct_sql.cc:1682
#10 0x00007ff3bed4f6c8 in spider_direct_sql (initid=0x7ff3bd822730, args=0x7ff3bd8226f0, is_null=0x7ff3bd822761 "", error=0x7ff3bd822760 "") at /data/src/10.0/storage/spider/spd_udf.cc:28
#11 0x00000000008a919e in udf_handler::val_int (this=0x7ff3bd8226e0, null_value=0x7ff3c7b30077 "") at /data/src/10.0/sql/sql_udf.h:109
#12 0x000000000089fe0c in Item_func_udf_int::val_int (this=0x7ff3bd822618) at /data/src/10.0/sql/item_func.cc:3817
#13 0x00000000008542f7 in Item::send (this=0x7ff3bd822618, protocol=0x7ff3bfa985f8, buffer=0x7ff3c7b30160) at /data/src/10.0/sql/item.cc:6549
#14 0x000000000059f1d8 in Protocol::send_result_set_row (this=0x7ff3bfa985f8, row_items=0x7ff3bfa9c218) at /data/src/10.0/sql/protocol.cc:912
#15 0x000000000060d779 in select_send::send_data (this=0x7ff3bd822940, items=...) at /data/src/10.0/sql/sql_class.cc:2573
#16 0x00000000006817f9 in JOIN::exec_inner (this=0x7ff3bd822960) at /data/src/10.0/sql/sql_select.cc:2459
#17 0x0000000000681216 in JOIN::exec (this=0x7ff3bd822960) at /data/src/10.0/sql/sql_select.cc:2373
#18 0x000000000068457e in mysql_select (thd=0x7ff3bfa98070, rref_pointer_array=0x7ff3bfa9c378, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147486464, result=0x7ff3bd822940, unit=0x7ff3bfa9ba10, select_lex=0x7ff3bfa9c100) at /data/src/10.0/sql/sql_select.cc:3308
#19 0x000000000067a93a in handle_select (thd=0x7ff3bfa98070, lex=0x7ff3bfa9b948, result=0x7ff3bd822940, setup_tables_done_option=0) at /data/src/10.0/sql/sql_select.cc:373
#20 0x000000000064f197 in execute_sqlcom_select (thd=0x7ff3bfa98070, all_tables=0x0) at /data/src/10.0/sql/sql_parse.cc:5294
#21 0x00000000006476c2 in mysql_execute_command (thd=0x7ff3bfa98070) at /data/src/10.0/sql/sql_parse.cc:2563
#22 0x0000000000651e18 in mysql_parse (thd=0x7ff3bfa98070, rawbuf=0x7ff3bd822088 "SELECT spider_direct_sql('ALTER SESSION SET NLS_DATE_FORMAT=\\'YYYY-MM-DD HH24:MI:SS\\'', '', 'srv \"s_2_1\"')", length=106, parser_state=0x7ff3c7b31650) at /data/src/10.0/sql/sql_parse.cc:6576
#23 0x0000000000644918 in dispatch_command (command=COM_QUERY, thd=0x7ff3bfa98070, packet=0x7ff3bfa9e071 "", packet_length=106) at /data/src/10.0/sql/sql_parse.cc:1309
#24 0x0000000000643bdb in do_command (thd=0x7ff3bfa98070) at /data/src/10.0/sql/sql_parse.cc:999
#25 0x0000000000761efa in do_handle_one_connection (thd_arg=0x7ff3bfa98070) at /data/src/10.0/sql/sql_connect.cc:1378
#26 0x0000000000761c6c in handle_one_connection (arg=0x7ff3bfa98070) at /data/src/10.0/sql/sql_connect.cc:1293
#27 0x00000000009faa88 in pfs_spawn_thread (arg=0x7ff3bf9975f0) at /data/src/10.0/storage/perfschema/pfs.cc:1860
#28 0x00007ff3c78000a4 in start_thread (arg=0x7ff3c7b32700) at pthread_create.c:309
#29 0x00007ff3c59b887d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Same with other spider/oracle tests.



 Comments   
Comment by Jacob Mathew (Inactive) [ 2017-02-28 ]

The crash occurs due to code that is #ifdef'd out with HAVE_ORACLE_OCI that pertains to the use of Spider with an Oracle data tier. Enabling this code eliminates the crash.

Comment by Jacob Mathew (Inactive) [ 2018-03-17 ]

The reason that MariaDB needs to support Oracle storage at the data tier is to help customers migrate from Oracle. It is necessary to build Spider with the additional build flag -DHAVE_ORACLE_OCI, and install and start Oracle before running the Oracle test suite or any tests within it. Nevertheless, if Spider is built normally and Oracle has not been started, these tests should not cause the MariaDB server to crash. With the bug fix in place, the crash is replaced with the following error:

ERROR 12501 (HY000) at line 4: The connect info 'ORACLE' is invalid

Comment by Jacob Mathew (Inactive) [ 2018-03-17 ]

Kentoku, please review my fix for this problem in commit 5d4df28 on my branch.

Comment by Kentoku Shiba (Inactive) [ 2018-03-17 ]

Hi Jacob,
I wrote a comment for your commit. But, it's ok to push.

Comment by Jacob Mathew (Inactive) [ 2018-03-19 ]

Fix is pushed to 10.1.32.

Generated at Thu Feb 08 07:46:28 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.