MySQL Forums
Forum List  »  Stored Procedures

Mysql 8.0 crash while calling stored proc
Posted by: George Eliozov
Date: March 06, 2021 02:44AM

Hello,

I'm not sure where to post this type of questions, first time on this forum, sorry, posting here.

Recently I have upgraded mysql from 5.7 to 8.0 (OS: FreeBSD 12.2 release)

now some of the stored proc cause a server to crash:

This one works:
~~~ cat testsp ~~~
CREATE DEFINER=`root`@`localhost` PROCEDURE `testsp`()
BEGIN
declare pw_hash varchar(200);
set pw_hash = md5(rand());
END
~~~ end cat ~~~


while this one cause a crash:

~~~ cat testsp2 ~~~
CREATE DEFINER=`root`@`localhost` PROCEDURE `testsp`()
BEGIN
declare pw_hash varchar(200);
set pw_hash = md5(rand());

--- next line cause server to crash ---
select pw_hash;
END
~~~ end cat ~~~


here is the error log file report:

~~~ cat srv.err ~~~
----- 8< -----
Assertion failed: (m_sp == current_thd->sp_runtime_ctx->sp), function this_item, file /usr/ports/databases/mysql80-server/work/mysql-8.0.23/sql/item.cc, line 1730.
17:09:55 UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x85ccb7000
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...
[0x231d8c6] unsigned char+0x1c6
[0x804552b70] _pthread_cleanup_pop+0x1c6
[0x80455213f] _pthread_cleanup_pop+0x1c6
[0x7ffffffff003] +0x1c6
[0x804721c2a] __error+0x1c6
[0x804720084] __error+0x1c6
[0x804696279] __error+0x1c6
[0x804710291] __error+0x1c6
[0x1e5da8f] Item_splocal::this_item(void)+0x9f
[0x1e5d612] Item_sp_variable::fix_fields(THD*, Item**)+0x12
[0x20b1604] setup_fields(THD*, unsigned long, bool, bool, bool, mem_root_deque<Item*> const*, mem_root_deque<Item*>*, Bounds_checked_array<Item*>)+0x384
[0x21eadd6] SELECT_LEX::prepare(THD*, mem_root_deque<Item*>*)+0x3d6
[0x2204d82] Sql_cmd_select::prepare_inner(THD*)+0x242
[0x2204914] Sql_cmd_dml::prepare(THD*)+0x274
[0x2205067] Sql_cmd_dml::execute(THD*)+0x287
[0x21a3deb] mysql_execute_command(THD*, bool)+0x129b
[0x20770fe] sp_instr_stmt::exec_core(THD*, unsigned int*)+0x4e
[0x207596d] sp_lex_instr::reset_lex_and_exec_core(THD*, unsigned int*, bool)+0x1ed
[0x20763d3] sp_lex_instr::validate_lex_and_execute_core(THD*, unsigned int*, bool)+0x1c3
[0x20767d8] sp_instr_stmt::execute(THD*, unsigned int*)+0x148
[0x206f386] sp_head::execute(THD*, bool)+0x586
[0x2070c94] sp_head::execute_procedure(THD*, mem_root_deque<Item*>*)+0x534
[0x20ba2dd] Sql_cmd_call::execute_inner(THD*)+0xfd
[0x22051d0] Sql_cmd_dml::execute(THD*)+0x3f0
[0x21a3deb] mysql_execute_command(THD*, bool)+0x129b
[0x21a1711] dispatch_sql_command(THD*, Parser_state*)+0x431
[0x21a0060] dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x1b10
[0x21a0f88] do_command(THD*)+0x1c8
[0x23055cb] Per_thread_connection_handler::add_connection(Channel_info*)+0x46b
[0x34765e2] pfs_spawn_thread_vc(unsigned int, my_thread_handle*, pthread_attr* const*, void*(*)(void*), void*)+0x312
[0x80454cfac] _pthread_cleanup_pop+0x312
[0x0] +0x312
[0x804720084] __error+0x312
stack_bottom = 7fffda1dcf60 thread_stack 0x46000
0x307684e <_Z19my_print_stacktracePKhm+0x10e> at /usr/local/libexec/mysqld
0x231d8c6 <handle_fatal_signal+0x1c6> at /usr/local/libexec/mysqld
0x804552b70 <_pthread_sigmask+0x530> at /lib/libthr.so.3

----- 8< -----

~~~ end cat ~~~


Thanks.

Options: ReplyQuote


Subject
Views
Written By
Posted
Mysql 8.0 crash while calling stored proc
1643
March 06, 2021 02:44AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.