[MDEV-15449] Signal 11 using LAST_INSERT_ID() as parameter in stored procedure Created: 2018-03-02  Updated: 2018-03-05  Resolved: 2018-03-05

Status: Closed
Project: MariaDB Server
Component/s: Stored routines
Affects Version/s: 10.2.13
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Rich Theobald Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Ubuntu 14.04


Issue Links:
Relates
relates to MDEV-15328 MariaDB 10.2.13 Crashes upon CALL PRO... Closed

 Description   

Following test case crashes server with Signal 11:

MariaDB [test]> CREATE PROCEDURE foo ( IN i INT UNSIGNED ) BEGIN END;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> CALL foo( LAST_INSERT_ID() );
ERROR 2013 (HY000): Lost connection to MySQL server during query

Crash report:

180220 21:49:42 [ERROR] mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
 
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
 
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.
 
Server version: 10.2.13-MariaDB-10.2.13+maria~trusty-log
key_buffer_size=134217728
read_buffer_size=2097152
max_used_connections=1
max_threads=1002
thread_count=18
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 6308732 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x7fcd60000a88
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x7fcd1cb65e40 thread_stack 0x49000
/usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x7fcd916a027e]
/usr/sbin/mysqld(handle_fatal_signal+0x355)[0x7fcd91125295]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7fcd8f3df330]
/usr/sbin/mysqld(_ZN24Item_func_last_insert_id10fix_fieldsEP3THDPP4Item+0x37)[0x7fcd9118d2a7]
/usr/sbin/mysqld(_Z20sp_prepare_func_itemP3THDPP4Item+0x3f)[0x7fcd912557ef]
/usr/sbin/mysqld(_Z12sp_eval_exprP3THDP5FieldPP4Item+0x3c)[0x7fcd912558bc]
/usr/sbin/mysqld(_ZN11sp_rcontext12set_variableEP3THDP5FieldPP4Item+0x17)[0x7fcd9125e357]
/usr/sbin/mysqld(_ZN7sp_head17execute_procedureEP3THDP4ListI4ItemE+0xe3)[0x7fcd91257e73]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x6b88)[0x7fcd90f972e8]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x351)[0x7fcd90f99fa1]
/usr/sbin/mysqld(+0x4e688f)[0x7fcd90f9a88f]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x22e0)[0x7fcd90f9d3b0]
/usr/sbin/mysqld(_Z10do_commandP3THD+0x149)[0x7fcd90f9e6f9]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP7CONNECT+0x1aa)[0x7fcd9106535a]
/usr/sbin/mysqld(handle_one_connection+0x3d)[0x7fcd9106547d]
/usr/sbin/mysqld(+0x828d7d)[0x7fcd912dcd7d]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8184)[0x7fcd8f3d7184]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fcd8eafabed]
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7fcd6000f280): CALL foo( LAST_INSERT_ID() )
 
Connection ID (thread ID): 49
Status: NOT_KILLED
 
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
 
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.



 Comments   
Comment by Elena Stepanova [ 2018-03-05 ]

As you found out yourself, it's the same problem as MDEV-15328, although your test case is much simpler, thanks for it. Let's track it further in MDEV-15328, since it was filed first and has more watchers.

Generated at Thu Feb 08 08:21:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.