Test rpl.rpl_bug58546 may crash server due to concurrent DBUG access

Bug #1613728 reported by Laurynas Biveinis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Fix Released
Low
Laurynas Biveinis
5.6
Fix Released
Low
Laurynas Biveinis
5.7
Fix Released
Low
Laurynas Biveinis

Bug Description

This is similar to bug 1607359 / bug 1606782 / https://bugs.mysql.com/bug.php?id=58754: setting DEBUG while there are concurrent readers (in this case binlog dump thread) may crash the server.

PS 5.5 trunk:

rpl.rpl_bug58546 'stmt' w1 [ fail ]
        Test ended at 2016-08-12 14:13:01

CURRENT_TEST: rpl.rpl_bug58546
mysqltest: In included file "./include/rpl_end.inc":
included from ./include/rpl_end.inc at line 77:
At line 77: query 'let $_tmp= query_get_value(SHOW SLAVE STATUS, Master_Host, 1)' failed: 2013: Lost connection to MySQL server during query

The result from queries just before the failure was:
< snip >
BEGIN;
INSERT INTO t1 VALUES(2, 2);
INSERT INTO t2 VALUES(1);
UPDATE t1 SET c2 = 3 WHERE c1 = 1;
COMMIT;
[connection slave1]
STOP SLAVE;
[connection slave]
ROLLBACK;
[connection master]
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
SET DEBUG_SYNC= 'RESET';
[connection slave]
include/wait_for_slave_to_stop.inc
[connection slave1]
include/start_slave.inc
[connection master]
DROP TABLE t1, t2;
SET GLOBAL debug= $debug_save;
include/rpl_end.inc
...
Program terminated with signal SIGSEGV, Segmentation fault.
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
62 ../sysdeps/unix/sysv/linux/pthread_kill.c: No such file or directory.
[Current thread is 1 (Thread 0x7fec484b9700 (LWP 4272))]
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
#1 0x0000000000807c63 in my_write_core (sig=sig@entry=11) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/mysys/stacktrace.c:433
#2 0x00000000006c558f in handle_fatal_signal (sig=11) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/sql/signal_handler.cc:250
#3 <signal handler called>
#4 internal_fnmatch (pattern=<optimized out>, string=string@entry=0xae2550 "warning", string_end=0xae2557 "", no_leading_period=no_leading_period@entry=0, flags=flags@entry=0, ends=ends@entry=0x0, alloca_used=0) at fnmatch_loop.c:56
#5 0x00007fec4aae8b7d in __fnmatch (pattern=pattern@entry=0xa <error: Cannot access memory at address 0xa>, string=string@entry=0xae2550 "warning", flags=flags@entry=0) at fnmatch.c:451
#6 0x0000000000a7ebde in InList (linkp=0x1, cp=cp@entry=0xae2550 "warning") at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/dbug/dbug.c:1502
#7 0x0000000000a8007e in _db_keyword_ (cs=cs@entry=0x7fec0c000a10, keyword=0xae2550 "warning", strict=65538, strict@entry=0) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/dbug/dbug.c:1719
#8 0x0000000000a8015b in _db_doprnt_ (format=format@entry=0xb65eb8 "Read only %d bytes off %lu from %d, errno: %d") at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/dbug/dbug.c:1263
#9 0x0000000000803f06 in my_read (Filedes=Filedes@entry=60, Buffer=Buffer@entry=0x7fec0c007d10 "\254\021\256W\002\001", Count=Count@entry=7072, MyFlags=MyFlags@entry=16) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/mysys/my_read.c:66
#10 0x00000000007ec87d in inline_mysql_file_read (flags=16, count=7072, buffer=0x7fec0c007d10 "\254\021\256W\002\001", file=60, src_line=563, src_file=0xb60c40 "/mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/mysys/mf_iocache.c") at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/include/mysql/psi/mysql_file.h:1144
#11 _my_b_read (info=0x7fec484b7a10, Buffer=0x7fec484b7830 "\200xKH\354\177", Count=19) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/mysys/mf_iocache.c:562
#12 0x000000000076cf18 in Log_event::read_log_event (file=file@entry=0x7fec484b7a10, packet=packet@entry=0x1fb7a60, log_lock=log_lock@entry=0x0, log_file_name_arg=log_file_name_arg@entry=0x0, is_binlog_active=is_binlog_active@entry=0x0) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/sql/log_event.cc:1049
#13 0x00000000005bbefd in mysql_binlog_send (thd=thd@entry=0x1fb73d0, log_ident=0x7fec0c004c30 "master-bin.000001", pos=<optimized out>, pos@entry=1011, flags=flags@entry=0) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/sql/sql_repl.cc:834
#14 0x00000000005a441e in dispatch_command (command=command@entry=COM_BINLOG_DUMP, thd=thd@entry=0x1fb73d0, packet=packet@entry=0x1fba6f1 "", packet_length=packet_length@entry=27) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/sql/sql_parse.cc:1272
#15 0x00000000005a5745 in do_command (thd=0x1fb73d0) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/sql/sql_parse.cc:789
#16 0x000000000065a0f9 in do_handle_one_connection (thd_arg=thd_arg@entry=0x1fb73d0) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/sql/sql_connect.cc:1418
#17 0x000000000065a1f6 in handle_one_connection (arg=arg@entry=0x1fb73d0) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/sql/sql_connect.cc:1325
#18 0x0000000000a68b34 in pfs_spawn_thread (arg=0x1f6eba0) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-xenial-64bit/storage/perfschema/pfs.cc:1015
#19 0x00007fec4bf6f6fa in start_thread (arg=0x7fec484b9700) at pthread_create.c:333
#20 0x00007fec4ab1ab5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Tags: ci upstream
tags: added: ci upstream
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
Download full text (4.1 KiB)

rpl.rpl_bug58546 'stmt' w3 [ fail ]
        Test ended at 2016-08-18 07:27:35

CURRENT_TEST: rpl.rpl_bug58546
mysqltest: In included file "./include/rpl_end.inc":
included from ./include/rpl_end.inc at line 77:
At line 77: query 'let $_tmp= query_get_value(SHOW SLAVE STATUS, Master_Host, 1)' failed: 2013: Lost connection to MySQL server during query
...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-wily-64bit'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
62 ../sysdeps/unix/sysv/linux/pthread_kill.c: No such file or directory.
[Current thread is 1 (Thread 0x7f5518940700 (LWP 10867))]
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
#1 0x0000000000806131 in my_write_core (sig=sig@entry=11) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-wily-64bit/mysys/stacktrace.c:433
#2 0x00000000006c3a87 in handle_fatal_signal (sig=11) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-wily-64bit/sql/signal_handler.cc:250
#3 <signal handler called>
#4 internal_fnmatch (pattern=<optimized out>, string=string@entry=0xb31dd4 "error", string_end=0xb31dd9 "", no_leading_period=no_leading_period@entry=0, flags=flags@entry=0, ends=ends@entry=0x0, alloca_used=0) at fnmatch_loop.c:62
#5 0x00007f551c13324d in __fnmatch (pattern=pattern@entry=0x10000000b <error: Cannot access memory at address 0x10000000b>, string=string@entry=0xb31dd4 "error", flags=flags@entry=0) at fnmatch.c:458
#6 0x0000000000a7d0b8 in InList (linkp=0x100000002, cp=cp@entry=0xb31dd4 "error") at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-wily-64bit/dbug/dbug.c:1502
#7 0x0000000000a7e558 in _db_keyword_ (cs=cs@entry=0x7f54e4000a10, keyword=0xb31dd4 "error", strict=65538, strict@entry=0) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-wily-64bit/dbug/dbug.c:1719
#8 0x0000000000a7e635 in _db_doprnt_ (format=format@entry=0xb4d5c3 "file->error: %d") at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-wily-64bit/dbug/dbug.c:1263
#9 0x000000000076b42c in Log_event::read_log_event (file=file@entry=0x7f551893ea10, packet=packet@entry=0x239e8c0, log_lock=log_lock@entry=0x11af608 <mysql_bin_log+8>, log_file_name_arg=log_file_name_arg@entry=0x7f551893eb70 "./master-bin.000001", is_binlog_active=is_binlog_active@entry=0x7f551893e97f) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-wily-64bit/sql/log_event.cc:1056
#10 0x00000000005b9f11 in mysql_binlog_send (thd=thd@entry=0x239e230, log_ident=0x7f54e4011b40 "master-bin.000001", pos=<optimized out>, pos@entry=4, flags=flags@entry=0) at /mnt/workspace/percona-server-5.5-trunk/BUILD_TYPE/debug/Host/ubuntu-wily-64bit/sql/sql_repl.cc:683
#11 0x00000000005a295d in dispatch_command (command=command@entry=COM_BINLOG_DUMP, thd=thd@entry=0x239e230, p...

Read more...

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-2173

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.