[MDEV-9950] Connect Engine: segfault, longjmp causes uninitialized stack frame Created: 2016-04-19  Updated: 2016-05-13  Resolved: 2016-05-13

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Connect
Affects Version/s: 10.1.12, 10.1
Fix Version/s: 10.0.26, 10.1.15

Type: Bug Priority: Major
Reporter: Sergey Antonyuk Assignee: Olivier Bertrand
Resolution: Fixed Votes: 0
Labels: None
Environment:

3.2.0-4-amd64 #1 SMP Debian 3.2.35-2 x86_64 GNU/Linux


Attachments: File plgdbutl.cpp    

 Description   

Unfortunately I can't provide the scenario to reproduce the problem.

Apr 13 07:28:14 dev mysqld: fatal flex scanner internal error--end of buffer missed
Apr 13 07:28:14 dev mysqld: *** longjmp causes uninitialized stack frame ***: /usr/sbin/mysqld terminated
Apr 13 07:28:14 dev mysqld: ======= Backtrace: =========
Apr 13 07:28:14 dev mysqld: /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7fdc734f9a97]
Apr 13 07:28:14 dev mysqld: /lib/x86_64-linux-gnu/libc.so.6(+0xf2a29)[0x7fdc734f9a29]
Apr 13 07:28:14 dev mysqld: /lib/x86_64-linux-gnu/libc.so.6(__longjmp_chk+0x33)[0x7fdc734f9993]
Apr 13 07:28:14 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(+0x91625)[0x7fdc6d524625]
Apr 13 07:28:14 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(+0x92aa2)[0x7fdc6d525aa2]
Apr 13 07:28:14 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(_Z14MakeDateFormatP7_globalPcbbi+0xd2)[0x7fdc6d55bcb2]
Apr 13 07:28:14 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(_ZN5DTVAL9SetFormatEP7_globalPcii+0x45)[0x7fdc6d58da15]
Apr 13 07:28:14 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(_ZN8TDBMYSQL6OpenDBEP7_global+0x82)[0x7fdc6d576c82]
Apr 13 07:28:14 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(_Z12CntOpenTableP7_globalP3TDB4MODEPcS4_bP10ha_connect+0x3b8)[0x7fdc6d521ce8]
Apr 13 07:28:14 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(_ZN10ha_connect9OpenTableEP7_globalb+0x1b4)[0x7fdc6d515534]
Apr 13 07:28:14 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(_ZN10ha_connect8rnd_initEb+0x1c2)[0x7fdc6d515c72]
Apr 13 07:28:14 dev mysqld: /usr/sbin/mysqld(_ZN7handler22ha_rnd_init_with_errorEb+0x19)[0x7fdc75a1f1b9]
Apr 13 07:28:14 dev mysqld: /usr/sbin/mysqld(_Z16init_read_recordP11READ_RECORDP3THDP5TABLEP10SQL_SELECTibb+0x3f6)[0x7fdc75b10ea6]
Apr 13 07:28:14 dev mysqld: /usr/sbin/mysqld(_Z21join_init_read_recordP13st_join_table+0x80)[0x7fdc758dec60]
Apr 13 07:28:14 dev mysqld: /usr/sbin/mysqld(_Z10sub_selectP4JOINP13st_join_tableb+0x169)[0x7fdc758deec9]
Apr 13 07:28:14 dev mysqld: /usr/sbin/mysqld(+0x4b09bd)[0x7fdc758eb9bd]
Apr 13 07:28:14 dev mysqld: /usr/sbin/mysqld(_ZN4JOIN10exec_innerEv+0xb50)[0x7fdc758fc5a0]
Apr 13 07:28:14 dev mysqld: /usr/sbin/mysqld(_ZN4JOIN4execEv+0x5d)[0x7fdc758fe52d]
Apr 13 07:28:14 dev mysqld: /usr/sbin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x12a)[0x7fdc758faeda]
Apr 13 07:28:14 dev mysqld: /usr/sbin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x25d)[0x7fdc758fe80d]
Apr 13 07:28:14 dev mysqld: /usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x7f9b)[0x7fdc758af10b]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x28d)[0x7fdc758b053d]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x2293)[0x7fdc758b2ff3]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z10do_commandP3THD+0x16b)[0x7fdc758b358b]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x17f)[0x7fdc7596f17f]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(handle_one_connection+0x47)[0x7fdc7596f2d7]
Apr 13 07:28:15 dev mysqld: /lib/x86_64-linux-gnu/libpthread.so.0(+0x6b50)[0x7fdc75003b50]
Apr 13 07:28:15 dev mysqld: /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fdc734e530d]

Apr 13 07:28:15 dev mysqld: ======= Memory map: ========
Apr 13 07:28:15 dev mysqld: 7fd9c0400000-7fda10400000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fda1077f000-7fda10780000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fda10780000-7fda90800000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fda909fc000-7fda909fd000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fda909fd000-7fda90a7d000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fda90a7d000-7fda90a7e000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fda90a7e000-7fda90afe000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fda90afe000-7fda90aff000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fda90aff000-7fda90b7f000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fda90b7f000-7fda90b80000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fda90b80000-7fdafa000000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdafa2fe000-7fdafa2ff000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdafa2ff000-7fdafa37f000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdafa37f000-7fdafa380000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdafa380000-7fdb02400000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb02479000-7fdb0247a000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb0247a000-7fdb024fa000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb024fa000-7fdb024fb000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb024fb000-7fdb0257b000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb0257b000-7fdb0257c000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb0257c000-7fdb025fc000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb025fc000-7fdb025fd000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb025fd000-7fdb0267d000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb0267d000-7fdb0267e000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb0267e000-7fdb026fe000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb026fe000-7fdb026ff000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb026ff000-7fdb0277f000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb0277f000-7fdb02780000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb02780000-7fdb16c00000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb16f7f000-7fdb16f80000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb16f80000-7fdb1f000000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb1f37f000-7fdb1f380000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb1f380000-7fdb4b400000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb4b6fe000-7fdb4b6ff000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb4b6ff000-7fdb4b77f000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb4b77f000-7fdb4b780000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb4b780000-7fdb63c00000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63c79000-7fdb63c7a000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63c7a000-7fdb63cfa000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63cfa000-7fdb63cfb000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63cfb000-7fdb63d7b000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63d7b000-7fdb63d7c000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63d7c000-7fdb63dfc000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63dfc000-7fdb63dfd000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63dfd000-7fdb63e7d000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63e7d000-7fdb63e7e000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63e7e000-7fdb63efe000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63efe000-7fdb63eff000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63eff000-7fdb63f7f000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63f7f000-7fdb63f80000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb63f80000-7fdb78400000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7877f000-7fdb78780000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb78780000-7fdb79800000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb799fc000-7fdb799fd000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb799fd000-7fdb79a7d000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb79a7d000-7fdb79a7e000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb79a7e000-7fdb79afe000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb79afe000-7fdb79aff000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb79aff000-7fdb79b7f000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb79b7f000-7fdb79b80000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb79b80000-7fdb7b000000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b377000-7fdb7b378000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b378000-7fdb7b3f8000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b3f8000-7fdb7b3f9000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b3f9000-7fdb7b479000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b479000-7fdb7b47a000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b47a000-7fdb7b4fa000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b4fa000-7fdb7b4fb000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b4fb000-7fdb7b57b000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b57b000-7fdb7b57c000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b57c000-7fdb7b5fc000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b5fc000-7fdb7b5fd000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b5fd000-7fdb7b67d000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b67d000-7fdb7b67e000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b67e000-7fdb7b6fe000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b6fe000-7fdb7b6ff000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b6ff000-7fdb7b77f000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b77f000-7fdb7b780000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7b780000-7fdb7c000000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7c0fa000-7fdb7c0fb000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7c0fb000-7fdb7c17b000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7c17b000-7fdb7c17c000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7c17c000-7fdb7c1fc000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7c1fc000-7fdb7c1fd000 ---p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7c1fd000-7fdb7c27d000 rw-p 00000000 00:00 0
Apr 13 07:28:15 dev mysqld: 7fdb7c27d000-7fdb7c27e000 ---p 00000000 00:00 0

Apr 13 07:28:15 dev mysqld: This could be because you hit a bug. It is also possible that this binary
Apr 13 07:28:15 dev mysqld: or one of the libraries it was linked against is corrupt, improperly built,
Apr 13 07:28:15 dev mysqld: or misconfigured. This error can also be caused by malfunctioning hardware.
Apr 13 07:28:15 dev mysqld:
Apr 13 07:28:15 dev mysqld: To report this bug, see http://kb.askmonty.org/en/reporting-bugs
Apr 13 07:28:15 dev mysqld:
Apr 13 07:28:15 dev mysqld: We will try our best to scrape up some info that will hopefully help
Apr 13 07:28:15 dev mysqld: diagnose the problem, but since we have already crashed,
Apr 13 07:28:15 dev mysqld: something is definitely wrong and this may fail.
Apr 13 07:28:15 dev mysqld:
Apr 13 07:28:15 dev mysqld: Server version: 10.1.12-MariaDB-1~wheezy
Apr 13 07:28:15 dev mysqld: key_buffer_size=33554432
Apr 13 07:28:15 dev mysqld: read_buffer_size=131072
Apr 13 07:28:15 dev mysqld: max_used_connections=62
Apr 13 07:28:15 dev mysqld: max_threads=302
Apr 13 07:28:15 dev mysqld: thread_count=44
Apr 13 07:28:15 dev mysqld: It is possible that mysqld could use up to
Apr 13 07:28:15 dev mysqld: key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 386837 K  bytes of memory
Apr 13 07:28:15 dev mysqld: Hope that's ok; if not, decrease some variables in the equation.
Apr 13 07:28:15 dev mysqld:
Apr 13 07:28:15 dev mysqld: Thread pointer: 0x0x7fdb79dc9008
Apr 13 07:28:15 dev mysqld: Attempting backtrace. You can use the following information to find out
Apr 13 07:28:15 dev mysqld: where mysqld died. If you see no messages after this, something went
Apr 13 07:28:15 dev mysqld: terribly wrong...
Apr 13 07:28:15 dev mysqld: stack_bottom = 0x7fdb63ffee30 thread_stack 0x80000
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(my_print_stacktrace+0x2b)[0x7fdc75eb908b]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(handle_fatal_signal+0x475)[0x7fdc75a19955]
Apr 13 07:28:15 dev mysqld: /lib/x86_64-linux-gnu/libpthread.so.0(+0xf0a0)[0x7fdc7500c0a0]
Apr 13 07:28:15 dev mysqld: /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35)[0x7fdc73439125]
Apr 13 07:28:15 dev mysqld: /lib/x86_64-linux-gnu/libc.so.6(abort+0x180)[0x7fdc7343c3a0]
Apr 13 07:28:15 dev mysqld: /lib/x86_64-linux-gnu/libc.so.6(+0x6c35b)[0x7fdc7347335b]
Apr 13 07:28:15 dev mysqld: /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7fdc734f9a97]
Apr 13 07:28:15 dev mysqld: /lib/x86_64-linux-gnu/libc.so.6(+0xf2a29)[0x7fdc734f9a29]
Apr 13 07:28:15 dev mysqld: /lib/x86_64-linux-gnu/libc.so.6(__longjmp_chk+0x33)[0x7fdc734f9993]
Apr 13 07:28:15 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(+0x91625)[0x7fdc6d524625]
Apr 13 07:28:15 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(+0x92aa2)[0x7fdc6d525aa2]
Apr 13 07:28:15 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(_Z14MakeDateFormatP7_globalPcbbi+0xd2)[0x7fdc6d55bcb2]
Apr 13 07:28:15 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(_ZN5DTVAL9SetFormatEP7_globalPcii+0x45)[0x7fdc6d58da15]
Apr 13 07:28:15 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(_ZN8TDBMYSQL6OpenDBEP7_global+0x82)[0x7fdc6d576c82]
Apr 13 07:28:15 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(_Z12CntOpenTableP7_globalP3TDB4MODEPcS4_bP10ha_connect+0x3b8)[0x7fdc6d521ce8]
Apr 13 07:28:15 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(_ZN10ha_connect9OpenTableEP7_globalb+0x1b4)[0x7fdc6d515534]
Apr 13 07:28:15 dev mysqld: /usr/lib/mysql/plugin/ha_connect.so(_ZN10ha_connect8rnd_initEb+0x1c2)[0x7fdc6d515c72]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_ZN7handler22ha_rnd_init_with_errorEb+0x19)[0x7fdc75a1f1b9]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z16init_read_recordP11READ_RECORDP3THDP5TABLEP10SQL_SELECTibb+0x3f6)[0x7fdc75b10ea6]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z21join_init_read_recordP13st_join_table+0x80)[0x7fdc758dec60]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z10sub_selectP4JOINP13st_join_tableb+0x169)[0x7fdc758deec9]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(+0x4b09bd)[0x7fdc758eb9bd]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_ZN4JOIN10exec_innerEv+0xb50)[0x7fdc758fc5a0]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_ZN4JOIN4execEv+0x5d)[0x7fdc758fe52d]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x12a)[0x7fdc758faeda]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x25d)[0x7fdc758fe80d]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x7f9b)[0x7fdc758af10b]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x28d)[0x7fdc758b053d]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x2293)[0x7fdc758b2ff3]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z10do_commandP3THD+0x16b)[0x7fdc758b358b]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x17f)[0x7fdc7596f17f]
Apr 13 07:28:15 dev mysqld: /usr/sbin/mysqld(handle_one_connection+0x47)[0x7fdc7596f2d7]
Apr 13 07:28:15 dev mysqld: /lib/x86_64-linux-gnu/libpthread.so.0(+0x6b50)[0x7fdc75003b50]
Apr 13 07:28:15 dev mysqld: /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fdc734e530d]
Apr 13 07:28:15 dev mysqld:
Apr 13 07:28:15 dev mysqld: Trying to get some variables.
Apr 13 07:28:15 dev mysqld: Some pointers may be invalid and cause the dump to abort.
Apr 13 07:28:15 dev mysqld: Query (0x7fdb7e074020): is an invalid pointer
Apr 13 07:28:15 dev mysqld: Connection ID (thread ID): 241
Apr 13 07:28:15 dev mysqld: Status: NOT_KILLED



 Comments   
Comment by Elena Stepanova [ 2016-04-20 ]

Is there anything you know about what was happening at the time of the crash, apart from it being a SELECT involving a CONNECT table.
Do you have many CONNECT tables? Do you, by any chance, have a general log or audit plugin enabled?
Did it only happen once, or did you observe the crash multiple times?

Thanks.

Comment by Sergey Antonyuk [ 2016-04-20 ]

Elena, we have a development server with MariaDB which is constantly creates many CONNECT tables to query data from remote MariaDB and MySQL servers. Requests are very different, tables are different. Unfortunately, the moment is lost, the problem is noticed later. There is no general log, audit plugin.

I will try to reproduce the problem.

Comment by Sergey Antonyuk [ 2016-04-21 ]

Possible requests performed during the problem:
1) CREATE TEMPORARY TABLE t (id INT, ts TIMESTAMP)
2) CREATE CONNECT TABLE c with TABNAME parameter specified and SRCDEF not specified. It points to the remote table r with a lot of fields including id, ts and more timestamp fields.
3) INSERT INTO t SELECT id, ts FROM c;
4) INSERT INTO c SELECT fields, list, including, ts FROM local_table;

The ts field in remote table (r) possible was equal to 0 (1970-01-01 00:00:00) due to previously altered table (the ts column has been added).

I have tried different scenarios walking around the mentioned one but the problem has not occured. The real code works in parallel flows. I saw this problem occuring many times but during one day only.

Comment by Sergey Antonyuk [ 2016-04-25 ]

So I've found a way to reproduce the bug! The scenario is very simple, the key thing is the parallel execution and the timestamp column.

Server-A

CREATE TABLE t(`ts_change` timestamp NOT NULL DEFAULT '2000-01-01 00:00:00');
INSERT INTO t SELECT NULL FROM seq_1_to_10000;

Server-B

CREATE TABLE `c_1` ENGINE=CONNECT DEFAULT CHARSET=utf8 `TABLE_TYPE`=MYSQL `DBNAME`=db `OPTION_LIST`='host=127.0.0.1,port=33333,user=username,password=password' `tabname`='t';

Scenario for Server-B:
-----------
Execute the following SQL in the parallel threads (count doesn't matter) using bash and mysql client.

SELECT ts_change FROM c_1;

Actual result:
--------------
segfault

Comment by Elena Stepanova [ 2016-04-29 ]

Thanks a lot. I was able to reproduce the problem just as you described.

For bertrandop:
I did everything on a single server, ran the following:

create database serverA;
create database serverB;
create table serverA.t(`ts_change` timestamp NOT NULL DEFAULT '2000-01-01 00:00:00');
INSERT INTO serverA.t SELECT NULL FROM seq_1_to_10000;
CREATE TABLE serverB.`c_1` ENGINE=CONNECT DEFAULT CHARSET=utf8 `TABLE_TYPE`=MYSQL `DBNAME`=serverA `OPTION_LIST`='host=127.0.0.1,port=3306,user=root' `tabname`='t';

and then used mysqlslap to generate the concurrent flow:

client/mysqlslap --protocol=tcp --port=3306 -uroot --concurrency=10 --number-of-queries=10000 --query="SELECT ts_change FROM serverB.c_1" --create-schema=serverB

Apparently you need to have a reasonably fast machine (or just multiple cores), at first I tried to run it on a single-core VM and had no luck.
Release version crashes faster than debug, I guess because it's faster, but debug crashes too.

Stack trace from 10.1 commit 037b78e5ec2e28d0d4573605f7dc8d5e2b36a66f

#3  <signal handler called>
#4  0x00007f325e10e217 in fmdflex (ppp=0x7f3211400500) at 10.1/storage/connect/fmdlex.c:703
#5  0x00007f325e154e90 in MakeDateFormat (g=0x7f323a497000, dfmt=0x7f325e1be978 "YYYY-MM-DD hh:mm:ss", in=true, out=true, flag=0) at 10.1/storage/connect/plgdbutl.cpp:712
#6  0x00007f325e19d11e in DTVAL::SetFormat (this=0x7f32114004b0, g=0x7f323a497000, fmt=0x7f325e1be978 "YYYY-MM-DD hh:mm:ss", len=19, year=0) at 10.1/storage/connect/value.cpp:2396
#7  0x00007f325e179e00 in TDBMYSQL::OpenDB (this=0x7f32114002b8, g=0x7f323a497000) at 10.1/storage/connect/tabmysql.cpp:884
#8  0x00007f325e10a58b in CntOpenTable (g=0x7f323a497000, tdbp=0x7f32114002b8, mode=MODE_READ, c1=0x7f3211400418 "ts_change", c2=0x0, del=false) at 10.1/storage/connect/connect.cc:360
#9  0x00007f325e0f7ef1 in ha_connect::OpenTable (this=0x7f323a472888, g=0x7f323a497000, del=false) at 10.1/storage/connect/ha_connect.cc:1823
#10 0x00007f325e0fe1c3 in ha_connect::rnd_init (this=0x7f323a472888, scan=true) at 10.1/storage/connect/ha_connect.cc:3705
#11 0x00007f326aa6d91e in handler::ha_rnd_init (this=0x7f323a472888, scan=true) at 10.1/sql/handler.h:2768
#12 0x00007f326ad1fc7d in handler::ha_rnd_init_with_error (this=0x7f323a472888, scan=true) at 10.1/sql/handler.cc:2744
#13 0x00007f326ae5a673 in init_read_record (info=0x7f323a4469c0, thd=0x7f3243e25070, table=0x7f323a44fe70, select=0x7f323a446e40, use_record_cache=1, print_error=true, disable_rr_cache=false) at 10.1/sql/records.cc:281
#14 0x00007f326ab48924 in join_init_read_record (tab=0x7f323a446900) at 10.1/sql/sql_select.cc:19168
#15 0x00007f326ab46865 in sub_select (join=0x7f323a445978, join_tab=0x7f323a446900, end_of_records=false) at 10.1/sql/sql_select.cc:18256
#16 0x00007f326ab46139 in do_select (join=0x7f323a445978, fields=0x7f3243e292a0, table=0x0, procedure=0x0) at 10.1/sql/sql_select.cc:17914
#17 0x00007f326ab212e3 in JOIN::exec_inner (this=0x7f323a445978) at 10.1/sql/sql_select.cc:3228
#18 0x00007f326ab1e587 in JOIN::exec (this=0x7f323a445978) at 10.1/sql/sql_select.cc:2518
#19 0x00007f326ab21b3a in mysql_select (thd=0x7f3243e25070, rref_pointer_array=0x7f3243e29400, tables=0x7f323a445298, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f323a445958, unit=0x7f3243e28a88, select_lex=0x7f3243e29188) at 10.1/sql/sql_select.cc:3451
#20 0x00007f326ab175df in handle_select (thd=0x7f3243e25070, lex=0x7f3243e289c0, result=0x7f323a445958, setup_tables_done_option=0) at 10.1/sql/sql_select.cc:384
#21 0x00007f326aae7901 in execute_sqlcom_select (thd=0x7f3243e25070, all_tables=0x7f323a445298) at 10.1/sql/sql_parse.cc:5905
#22 0x00007f326aadd6ba in mysql_execute_command (thd=0x7f3243e25070) at 10.1/sql/sql_parse.cc:2960
#23 0x00007f326aaeaf48 in mysql_parse (thd=0x7f3243e25070, rawbuf=0x7f323a445088 "SELECT ts_change FROM serverB.c_1", length=33, parser_state=0x7f3229f1f5c0) at 10.1/sql/sql_parse.cc:7305
#24 0x00007f326aad9921 in dispatch_command (command=COM_QUERY, thd=0x7f3243e25070, packet=0x7f3243e2b071 "", packet_length=33) at 10.1/sql/sql_parse.cc:1486
#25 0x00007f326aad8653 in do_command (thd=0x7f3243e25070) at 10.1/sql/sql_parse.cc:1107
#26 0x00007f326ac0e4fa in do_handle_one_connection (thd_arg=0x7f3243e25070) at 10.1/sql/sql_connect.cc:1349
#27 0x00007f326ac0e25e in handle_one_connection (arg=0x7f3243e25070) at 10.1/sql/sql_connect.cc:1261
#28 0x00007f3268ef1e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#29 0x00007f326861ecbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#30 0x0000000000000000 in ?? ()

10.1 crashes, but I couldn't repeat the problem on 10.0.

Comment by Olivier Bertrand [ 2016-05-04 ]

Indeed the fmdflex function, generated by Bison, is not thread safe and must be called using a Critical Section on Windows or a mutex on Linux.
Because this code was imported from another product, this was made conditional. However, used in MariaDB it must be done all the time.
I have attached a modified version of plgdbutl.cpp. Can you test it and check whether this fixes the problem? (this temporary change is working only on Linux)
Thanks.

Comment by Sergey Antonyuk [ 2016-05-10 ]

I've installed 10.1.14 MariaDB and ha_connect.so compiled from 10.1.14 sources with the patch plgdbutl.cpp applied.
Any single SQL SELECT request which includes timestamp column freezes forever.

Comment by Sergey Antonyuk [ 2016-05-11 ]

The following modification of the patch code solves the problem:

  • parmut is a global variablle initialized as parmut = PTHREAD_MUTEX_INITIALIZER;
Comment by Olivier Bertrand [ 2016-05-11 ]

Sorry about that but thanks for reminding this to me. I had the same problem on Windows about initialising the Critical Section.
In fact, in the code from which this was copied, parmut was initialized but in another file.

What I'd like to know is whether this patch fixes the bug reported on this page?

Comment by Sergey Antonyuk [ 2016-05-11 ]

Yes, it fixes the problem! Thank you!

Generated at Thu Feb 08 07:38:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.