Skip to content
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

Fix crash and invalid write reported by valgrind for 'test_ps_async-t' #3324

Closed
5 tasks done
JavierJF opened this issue Mar 1, 2021 · 0 comments · Fixed by #3326
Closed
5 tasks done

Fix crash and invalid write reported by valgrind for 'test_ps_async-t' #3324

JavierJF opened this issue Mar 1, 2021 · 0 comments · Fixed by #3326

Comments

@JavierJF
Copy link
Collaborator

JavierJF commented Mar 1, 2021

  • A clear description of the issue

During testing several crashes was encountered while test 'test_ps_large_result-t' was being executed, crash could be reproduced locally successfully:

Error: signal 11:
./src/proxysql(_Z13crash_handleri+0x34)[0x558ae2e6fbd3]
/usr/lib/libc.so.6(+0x3cf80)[0x7f2c59d31f80]
./src/proxysql(_ZN15MySQL_ResultSet8add_row2EP13st_mysql_rowsPh+0x27)[0x558ae2f6a62d]
./src/proxysql(_ZN15MySQL_ResultSet14init_with_stmtEv+0x21f)[0x558ae2f69ec3]
./src/proxysql(_ZN13MySQL_Session31MySQL_Stmt_Result_to_MySQL_wireEP13st_mysql_stmtP16MySQL_Connection+0xa2)[0x558ae2f4f1c8]
./src/proxysql(_ZN13MySQL_Session35handler_rc0_PROCESSING_STMT_EXECUTEEP17MySQL_Data_Stream+0x61)[0x558ae2f40e39]
./src/proxysql(_ZN13MySQL_Session7handlerEv+0x106b)[0x558ae2f43453]
./src/proxysql(_ZN12MySQL_Thread20process_all_sessionsEv+0xeb8)[0x558ae2f10f9a]
./src/proxysql(_ZN12MySQL_Thread3runEv+0x14e6)[0x558ae2f0f020]
./src/proxysql(_Z24mysql_worker_thread_funcPv+0xca)[0x558ae2e6482e]
/usr/lib/libpthread.so.0(+0x9299)[0x7f2c5a235299]
/usr/lib/libc.so.6(clone+0x43)[0x7f2c59df4053]
 ---- ./src/proxysql(_Z13crash_handleri+0x34) [0x558ae2e6fbd3] : crash_handler(int)
 ---- ./src/proxysql(_ZN15MySQL_ResultSet8add_row2EP13st_mysql_rowsPh+0x27) [0x558ae2f6a62d] : MySQL_ResultSet::add_row2(st_mysql_rows*, unsigned char*)
 ---- ./src/proxysql(_ZN15MySQL_ResultSet14init_with_stmtEv+0x21f) [0x558ae2f69ec3] : MySQL_ResultSet::init_with_stmt()
 ---- ./src/proxysql(_ZN13MySQL_Session31MySQL_Stmt_Result_to_MySQL_wireEP13st_mysql_stmtP16MySQL_Connection+0xa2) [0x558ae2f4f1c8] : MySQL_Session::MySQL_Stmt_Result_to_MySQL_wire(st_mysql_stmt*, MySQL_Connection*)
 ---- ./src/proxysql(_ZN13MySQL_Session35handler_rc0_PROCESSING_STMT_EXECUTEEP17MySQL_Data_Stream+0x61) [0x558ae2f40e39] : MySQL_Session::handler_rc0_PROCESSING_STMT_EXECUTE(MySQL_Data_Stream*)
 ---- ./src/proxysql(_ZN13MySQL_Session7handlerEv+0x106b) [0x558ae2f43453] : MySQL_Session::handler()
 ---- ./src/proxysql(_ZN12MySQL_Thread20process_all_sessionsEv+0xeb8) [0x558ae2f10f9a] : MySQL_Thread::process_all_sessions()
 ---- ./src/proxysql(_ZN12MySQL_Thread3runEv+0x14e6) [0x558ae2f0f020] : MySQL_Thread::run()
 ---- ./src/proxysql(_Z24mysql_worker_thread_funcPv+0xca) [0x558ae2e6482e] : mysql_worker_thread_func(void*)
[1]    29078 segmentation fault (core dumped)  ./src/proxysql -f -c  -D single_datadir

Attached coredump and others drove investigation towards test_ps_async-t when valgrind reported a invalid writer error:
valgrind-out.txt

This error should be fixed and the parallel implementation of inside ProxySQL for which this test was a 'POC' shall be patched as well.

  • ProxySQL version

v2.1.1

  • OS version
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
  • The steps to reproduce the issue

Run test_ps_async-t under valgrind.

  • Coredump

crash_coredump.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant