Bug #76852 | Segmentation fault while starting MySQL with binary log in disk full Linux | ||
---|---|---|---|
Submitted: | 27 Apr 2015 12:18 | Modified: | 10 Nov 2016 17:26 |
Reporter: | Shahriyar Rzayev | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server | Severity: | S6 (Debug Builds) |
Version: | 5.6.24 | OS: | Linux (CentOS 6.5) |
Assigned to: | CPU Architecture: | Any | |
Tags: | debug |
[27 Apr 2015 12:18]
Shahriyar Rzayev
[27 Apr 2015 12:19]
Shahriyar Rzayev
bt full output from gdb
Attachment: bt_full.txt (text/plain), 6.09 KiB.
[27 Apr 2015 12:39]
MySQL Verification Team
Thank you for the report. Observed this with 5.6.24 debug build when partition was full and tried to start server. Core was generated by `bin/mysqld-debug --no-defaults --basedir=/data/ushastry/server/mysql-5.6.24 --d'. Program terminated with signal 11, Segmentation fault. #0 0x0000003d5a80c8ac in pthread_kill () from /lib64/libpthread.so.0 Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.149.el6_6.5.x86_64 libaio-0.3.107-10.el6.x86_64 libgcc-4.4.7-11.el6.x86_64 libstdc++-4.4.7-11.el6.x86_64 nss-softokn-freebl-3.14.3-22.el6_6.x86_64 (gdb) bt #0 0x0000003d5a80c8ac in pthread_kill () from /lib64/libpthread.so.0 #1 0x0000000000b01fd3 in my_write_core (sig=11) at /pb2/build/sb_0-14307455-1422989245.13/mysqlcom-pro-5.6.24/mysys/stacktrace.c:422 #2 0x0000000000780070 in handle_fatal_signal (sig=11) at /pb2/build/sb_0-14307455-1422989245.13/mysqlcom-pro-5.6.24/sql/signal_handler.cc:230 #3 <signal handler called> #4 0x0000000000000000 in ?? () #5 0x0000000000af91a0 in my_printf_warning (format=0x10f9c68 "Disk is full writing '%s' (Errcode: %d - %s). Waiting for someone to free space...") at /pb2/build/sb_0-14307455-1422989245.13/mysqlcom-pro-5.6.24/mysys/my_error.c:260 #6 0x0000000000ae0f7c in wait_for_free_space (filename=0x28f7130 "./binlog.~rec~", errors=0) at /pb2/build/sb_0-14307455-1422989245.13/mysqlcom-pro-5.6.24/mysys/errors.c:115 #7 0x0000000000b005f1 in my_write (Filedes=14, Buffer=0x2fc3b40 "./binlog.000005\n0;\374\002", Count=16, MyFlags=52) at /pb2/build/sb_0-14307455-1422989245.13/mysqlcom-pro-5.6.24/mysys/my_write.c:89 #8 0x0000000000ae4075 in inline_mysql_file_write (src_file=0x10fa520 "/pb2/build/sb_0-14307455-1422989245.13/mysqlcom-pro-5.6.24/mysys/mf_iocache.c", src_line=1788, file=14, buffer=0x2fc3b40 "./binlog.000005\n0;\374\002", count=16, flags=52) at /pb2/build/sb_0-14307455-1422989245.13/mysqlcom-pro-5.6.24/include/mysql/psi/mysql_file.h:1141 #9 0x0000000000ae713f in my_b_flush_io_cache (info=0x19a10a8, need_append_buffer_lock=0) at /pb2/build/sb_0-14307455-1422989245.13/mysqlcom-pro-5.6.24/mysys/mf_iocache.c:1787 #10 0x0000000000a8eaa9 in MYSQL_BIN_LOG::sync_purge_index_file (this=0x19a0500) at /pb2/build/sb_0-14307455-1422989245.13/mysqlcom-pro-5.6.24/sql/binlog.cc:4420 #11 0x0000000000a8bb9b in MYSQL_BIN_LOG::open_binlog (this=0x19a0500, log_name=0x28a7700 "binlog", new_name=0x0, io_cache_type_arg=WRITE_CACHE, max_size_arg=1073741824, null_created_arg=false, need_lock_index=true, need_sid_lock=true, extra_description_event=0x0) at /pb2/build/sb_0-14307455-1422989245.13/mysqlcom-pro-5.6.24/sql/binlog.cc:3146 #12 0x000000000067757d in init_server_components () at /pb2/build/sb_0-14307455-1422989245.13/mysqlcom-pro-5.6.24/sql/mysqld.cc:5008 #13 0x0000000000677ebd in mysqld_main (argc=40, argv=0x2808fd8) at /pb2/build/sb_0-14307455-1422989245.13/mysqlcom-pro-5.6.24/sql/mysqld.cc:5449 #14 0x000000000066cf74 in main (argc=40, argv=0x7fff0572d5d8) at /pb2/build/sb_0-14307455-1422989245.13/mysqlcom-pro-5.6.24/sql/main.cc:25 (gdb)
[18 Jan 2016 7:41]
Shahriyar Rzayev
Changed Category
[9 Nov 2016 17:54]
OCA Admin
Contribution submitted via Github - Bug #76852 - Segmentation fault while starting MySQL with binary log in disk ful (*) Contribution by Shahriyar Rzayev (Github ShahriyarR, mysql-server/pull/109#issuecomment-259478172): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: git_patch_92908928.txt (text/plain), 6.96 KiB.
[10 Nov 2016 17:26]
Shahriyar Rzayev
By mistake my IDE added new lines or did something wrong and there are too many changes appeared on patch. Exact changes: @@ -4663,6 +4663,8 @@ static int init_server_components() We need to call each of these following functions to ensure that all things are initialized so that unireg_abort() doesn't fail */ + sql_print_warning_hook = sql_print_warning; + mdl_init(); if (table_def_init() | hostname_cache_init(host_cache_size)) unireg_abort(1); @@ -5486,7 +5488,7 @@ int mysqld_main(int argc, char **argv) #endif } - /* + /* The subsequent calls may take a long time : e.g. innodb log read. Thus set the long running service control manager timeout */ @@ -5596,7 +5598,7 @@ int mysqld_main(int argc, char **argv) */ error_handler_hook= my_message_sql; start_signal_handler(); // Creates pidfile - sql_print_warning_hook = sql_print_warning; + diff --git a/mysys/my_error.c b/mysys/my_error.c index b1f57ba..4441228 100644 --- a/mysys/my_error.c +++ b/mysys/my_error.c @@ -257,7 +257,14 @@ void my_printf_warning(const char *format, ...) va_start(args,format); (void) my_vsnprintf (wbuff, sizeof(wbuff), format, args); va_end(args); - (*sql_print_warning_hook)(wbuff); + if(sql_print_warning_hook) + { + (*sql_print_warning_hook)(wbuff); + } + else + { + fprintf(stderr, "%s\n", wbuff); + } DBUG_VOID_RETURN; }
[29 Sep 2017 8:02]
Ståle Deraas
Thank you for the contribution Shahriyar. Since there has been quite a lot of code changes in the area in newer releases, we will work a bit more on your contribution, before pushing it.