0

I would like to ask if from below log we can say that crash of Mysql was because of our custom library for Mysql?

Sep 26 15:24:30 mysqld: /usr/lib/mysql/plugin/my_lib_discounts.so(_ZN13CDiscountCalcD1Ev+0x52)[0x7f5da35439da]
Sep 26 15:24:30 mysqld: /usr/lib/mysql/plugin/my_lib_discounts.so(my_lib_discountsAgg_deinit+0x31)[0x7f5da35431be]

whole log:

Sep 26 15:24:30 mysqld: Thread pointer: 0x7f5d980ab690 
Sep 26 15:24:30 mysqld: Attempting backtrace. You can use the following information to find out 
Sep 26 15:24:30 mysqld: where mysqld died. If you see no messages after this, something went 
Sep 26 15:24:30 mysqld: terribly wrong... 
Sep 26 15:24:30 mysqld: stack_bottom = 7f5da2d9de88 thread_stack 0x80000 
Sep 26 15:24:30 mysqld: /usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x7f5f02247ade] 
Sep 26 15:24:30 mysqld: /usr/sbin/mysqld(handle_fatal_signal+0x493)[0x7f5f020fe253]
Sep 26 15:24:30 mysqld: /lib/libpthread.so.0(+0xeff0)[0x7f5f018b3ff0] 
Sep 26 15:24:30 mysqld: /lib/libc.so.6(gsignal+0x35)[0x7f5f00164ed5] 
Sep 26 15:24:30 mysqld: /lib/libc.so.6(abort+0x180)[0x7f5f00167ce0] 
Sep 26 15:24:30 mysqld: /lib/libc.so.6(+0x682db)[0x7f5f0019b2db] 
Sep 26 15:24:30 mysqld: /lib/libc.so.6(+0x71b36)[0x7f5f001a4b36]
Sep 26 15:24:30 mysqld: /lib/libc.so.6(cfree+0x6c)[0x7f5f001a98ac] 
Sep 26 15:24:30 mysqld: /usr/lib/mysql/plugin/my_lib_discounts.so(_ZN13CDiscountCalcD1Ev+0x52)[0x7f5da35439da]
Sep 26 15:24:30 mysqld: /usr/lib/mysql/plugin/my_lib_discounts.so(my_lib_discountsAgg_deinit+0x31)[0x7f5da35431be] 
Sep 26 15:24:30 mysqld: /usr/sbin/mysqld(_ZN11udf_handler7cleanupEv+0x31)[0x7f5f02156bc1] 
Sep 26 15:24:30 mysqld: /usr/sbin/mysqld(_ZN12Item_udf_sum7cleanupEv+0x10)[0x7f5f021863c0] 
Sep 26 15:24:30 mysqld: /usr/sbin/mysqld(_ZN4JOIN7destroyEv+0x17e)[0x7f5f020183be] 
Sep 26 15:24:30 mysqld: /usr/sbin/mysqld(_ZN13st_select_lex7cleanupEv+0x22)[0x7f5f0205feb2]
Sep 26 15:24:30 mysqld: /usr/sbin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x233)[0x7f5f0202af53] 
Sep 26 15:24:30 mysqld: /usr/sbin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x174)[0x7f5f02030954] 
Sep 26 15:24:30 mysqld: /usr/sbin/mysqld(+0x30a287)[0x7f5f01feb287] 
Sep 26 15:24:30 mysqld: /usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x1be4)[0x7f5f01ff01b4] 
Sep 26 15:24:30 mysqld: /usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x246)[0x7f5f01ff2e26] 
Sep 26 15:24:30 mysqld: /usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x1d42)[0x7f5f01ff53d2]
Sep 26 15:24:30mysqld: /usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x10e)[0x7f5f0209724e]
Sep 26 15:24:30 mysqld: /usr/sbin/mysqld(handle_one_connection+0x50)[0x7f5f02097370] 
Sep 26 15:24:30 mysqld: /lib/libpthread.so.0(+0x68ca)[0x7f5f018ab8ca]
Sep 26 15:24:30 mysqld: /lib/libc.so.6(clone+0x6d)[0x7f5f002027dd]
Sep 26 15:24:30 mysqld: 
Sep 26 15:24:30 mysqld: Trying to get some variables.
Sep 26 15:24:30 mysqld: Some pointers may be invalid and cause the dump to abort.
Sep 26 15:24:30 mysqld: Query (7f5d980cdd90): is an invalid pointer 
Sep 26 15:24:30 mysqld: Connection ID (thread ID): 1087 
Sep 26 15:24:30 mysqld: Status: NOT_KILLED 

OS: Debian GNU/Linux 6.0

Mysql: Server version 5.5.38

We didn't install any new packages.

Problem occurs from time to time. Sometimes three times a day then we have no problem for about five days and so on. In error log we can see that there is a line with name of our plugin for mysql - but I'don't know if this is main cause or just information about loaded modules.

exxon
  • 83
  • 2
  • 12
  • Please provide some more information like did you install any supporting mysql packages recently or any other significant changes made to the system? Which version of Debian are you using? – vagarwal Sep 27 '17 at 14:29

1 Answers1

1

First of all, it is worth pointing out what that output in the log actually is, as you're clearly confused about that.

That trace in the log shows the call stack when the crash occurred, ie it is a listing of the "path" of function calls that lead to the crash.

While not absolutely conclusive, appears VERY likely that it's not coincidental that your plugin (which I think can be considered more likely to have problems, without being overly unfair) was part of the call stack that caused the crash.
It looks like it has some kind of memory management issue (based on the cfree call going badly).

The maintainer of that plugin ought to have a look at this.

Håkan Lindqvist
  • 35,011
  • 5
  • 69
  • 94
  • Thanks for clarify out this. Our programmer says that this plugin was made using a lot of pointers, so this makes sense. – exxon Sep 28 '17 at 07:01