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

Set mysql-show_processlist_extended make Proxysql crash #2863

Closed
8 tasks
Tusamarco opened this issue Jun 7, 2020 · 6 comments
Closed
8 tasks

Set mysql-show_processlist_extended make Proxysql crash #2863

Tusamarco opened this issue Jun 7, 2020 · 6 comments
Labels

Comments

@Tusamarco
Copy link

  • A clear description of the issue
    While running light load (5 threads 2 insert 2 select 1 delete ), once the parameter mysql-show_processlist_extended is inserted and loaded to runtime :
    update global_variables set Variable_Value=1 where Variable_name='mysql-show_processlist_extended';

ProxySQL crash.

/usr/bin/proxysql(_Z13crash_handleri+0x1a)[0x4b86da]
/lib64/libc.so.6(+0x363b0)[0x7ff9b30553b0]
/lib64/libc.so.6(+0x3af97)[0x7ff9b3059f97]
/usr/bin/proxysql(_ZN8Variable28fill_client_internal_sessionERN8nlohmann10basic_jsonISt3mapSt6vectorSsblmdSaNS0_14adl_serializerEEEi+0x5d7)[0x63b3b7]
/usr/bin/proxysql(_ZN13MySQL_Session39generate_proxysql_internal_session_jsonERN8nlohmann10basic_jsonISt3mapSt6vectorSsblmdSaNS0_14adl_serializerEEE+0x945)[0x513485]
/usr/bin/proxysql(_ZN21MySQL_Threads_Handler16SQL3_ProcesslistEv+0x6b6)[0x502486]
/usr/bin/proxysql(_ZN14ProxySQL_Admin25stats___mysql_processlistEv+0x4d)[0x539d3d]
/usr/bin/proxysql(_ZN14ProxySQL_Admin24GenericRefreshStatisticsEPKcjb+0x8d0)[0x55a1a0]
/usr/bin/proxysql(_Z21admin_session_handlerP13MySQL_SessionPvP10_PtrSize_t+0x14d)[0x5639cd]
/usr/bin/proxysql(_ZN13MySQL_Session7handlerEv+0x1a78)[0x5185c8]
/usr/bin/proxysql(_Z11child_mysqlPv+0x34d)[0x5320dd]
/lib64/libpthread.so.0(+0x7e65)[0x7ff9b4235e65]
/lib64/libc.so.6(clone+0x6d)[0x7ff9b311d88d]
2020-06-07 11:56:13 main.cpp:1564:ProxySQL_daemonize_phase3(): [ERROR] ProxySQL crashed. Restarting!
  • ProxySQL version
    [root@proxysql1 proxysql]# proxysql --version
    ProxySQL version 2.0.13-31-g6f11ea6, codename Truls

  • OS version
    Linux proxysql1 3.10.0-1062.12.1.el7.x86_64 Remove argument MySQL_Data_Stream from MySQL_Protocol's function #1 SMP Tue Feb 4 23:02:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
    [root@proxysql1 proxysql]# cat /etc/redhat-release
    CentOS Linux release 7.7.1908 (Core)

  • The steps to reproduce the issue
    For me was enough to change the parameter, see attached file for query digest

  • The full ProxySQL error log (default location: /var/lib/proxysql/proxysql.log)
    see attached compressed file

If this is a crashing bug, please also include:

  • The package used to install ProxySQL
    See attached compressed file
  • The compressed proxysql binary
    See attached compressed file
  • The compressed core dump (Note: if you're worried it may contain sensitive data, please
    See attached compressed file

Linux proxysql1 3.10.0-1062.12.1.el7.x86_64 #1 SMP Tue Feb 4 23:02:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@proxysql1 proxysql]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)

@Tusamarco
Copy link
Author

proxysql.zip

@Tusamarco
Copy link
Author

I have also inserted the proxysql.db and the executable.
BTW please note that by mistake I had type proxysql --vrsion and instead raising an error and show the help it actully start proxysql.. u may want to catch that as well

@renecannao
Copy link
Contributor

Hi Marco,

Thank you for the detailed report.
I am looking into fixing this ASAP (likely today).
Do you also have the proxysql.cnf file? I want to identify if something unusual was there.
Thank you

@renecannao
Copy link
Contributor

@Tusamarco:

I was about to ask if you have a reproducible test case, because I couldn't understand how it was possible to trigger this crash.
Specifically, client_myds->myconn->variables[8]->value (character_set_connection) and all other character set variables are all set to NULL.
Established sessions shouldn't have NULL value for such variables, and I couldn't understand why this is the case in your core dump.
The answer is in the core dump itself:

(gdb) p client_myds->DSS 
$19 = STATE_SERVER_HANDSHAKE
(gdb) p client_myds->pkts_recv 
$20 = 0
(gdb) p client_myds->pkts_sent 
$21 = 1
(gdb) p client_myds->bytes_info 
$22 = {bytes_recv = 0, bytes_sent = 78}

In other words, the client wasn't authenticated yet, it didn't complete the handshake, thus the charset variables weren't initialized yet.
This means you managed to query stats_mysql_processlist while a client was in the middle of an authentication.
This is surely a bug, and we will fix it ASAP.

Thank you again for the report.

renecannao added a commit that referenced this issue Jun 7, 2020
Prevent crash if CHARACTER_SET_CONNECTION is not initialized yet #2863
@Tusamarco
Copy link
Author

@renecannao as u know use sysbench / sysbench-tpcc and the stresstool (java).
The issue I had was with the java app test. If you still need it I can pass to u the exact configuration file and command to run it.
Code is in github :
https://github.com/Tusamarco/stresstool

Anyhow I saw u have already merged with v2.013 will test and let u know

@Tusamarco
Copy link
Author

Tusamarco commented Jun 8, 2020

@renecannao tested and seems resolved will keep you informed if any issue will raise again.
For me this can be close.

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

No branches or pull requests

2 participants