Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8540

Crash on server shutdown since 10.0.16

    Details

    • Type: Bug
    • Status: Confirmed
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0
    • Fix Version/s: 10.0
    • Component/s: None
    • Labels:
      None

      Description

      This problem was first found in 10.0.20, and I bisected it back to 10.0.16. Every time the server is shut down, it crashes. I am able to reproduce this with an empty data directory.

      150724 13:08:00 [Note] /nix/store/w2f13ydy5nyp53vsi17k6y0igkw99d7l-mariadb-10.0.16/bin/mysqld: Normal shutdown
      
      150724 13:08:00 [Note] Event Scheduler: Purging the queue. 0 events
      150724 13:08:00 [ERROR] mysqld got signal 11 ;
      This could be because you hit a bug. It is also possible that this binary
      or one of the libraries it was linked against is corrupt, improperly built,
      or misconfigured. This error can also be caused by malfunctioning hardware.
      
      To report this bug, see http://kb.askmonty.org/en/reporting-bugs
      
      We will try our best to scrape up some info that will hopefully help
      diagnose the problem, but since we have already crashed,
      something is definitely wrong and this may fail.
      
      Server version: 10.0.16-MariaDB-log
      key_buffer_size=134217728
      read_buffer_size=131072
      max_used_connections=1
      max_threads=1026
      thread_count=0
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 2384868 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
      
      Thread pointer: 0x0x0
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x0 thread_stack 0x48000
      /nix/store/w2f13ydy5nyp53vsi17k6y0igkw99d7l-mariadb-10.0.16/bin/mysqld(my_print_stacktrace+0x29)[0xb75919]
      /nix/store/w2f13ydy5nyp53vsi17k6y0igkw99d7l-mariadb-10.0.16/bin/mysqld(handle_fatal_signal+0x398)[0x721868]
      /nix/store/la5imi1602jxhpds9675n2n2d0683lbq-glibc-2.20/lib/libpthread.so.0(+0x10020)[0x7f8852c59020]
      /nix/store/w2f13ydy5nyp53vsi17k6y0igkw99d7l-mariadb-10.0.16/bin/mysqld(_ZN13MYSQL_BIN_LOG5closeEj+0x2cf)[0x7da30f]
      /nix/store/w2f13ydy5nyp53vsi17k6y0igkw99d7l-mariadb-10.0.16/bin/mysqld(_ZN13MYSQL_BIN_LOG7cleanupEv+0x52)[0x7da422]
      /nix/store/w2f13ydy5nyp53vsi17k6y0igkw99d7l-mariadb-10.0.16/bin/mysqld[0x53402d]
      /nix/store/w2f13ydy5nyp53vsi17k6y0igkw99d7l-mariadb-10.0.16/bin/mysqld(_Z10unireg_endv+0x2d)[0x535fed]
      /nix/store/w2f13ydy5nyp53vsi17k6y0igkw99d7l-mariadb-10.0.16/bin/mysqld[0x538ab9]
      /nix/store/w2f13ydy5nyp53vsi17k6y0igkw99d7l-mariadb-10.0.16/bin/mysqld(kill_server_thread+0xe)[0x538b8e]
      /nix/store/la5imi1602jxhpds9675n2n2d0683lbq-glibc-2.20/lib/libpthread.so.0(+0x8374)[0x7f8852c51374]
      /nix/store/la5imi1602jxhpds9675n2n2d0683lbq-glibc-2.20/lib/libc.so.6(clone+0x6d)[0x7f88514c9f9d]
      The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
      information that should help you find out what is causing the crash.
      

      I attached the config file in use. MariaDB is built from source. The OS is NixOS.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -
            Show
            elenst Elena Stepanova added a comment - Hoang Xuan Phu , Here is my public key: https://launchpad.net/~elenst/+sshkeys
            Hide
            phunehehe Hoang Xuan Phu added a comment -

            (I'm preparing the temporary system, but it's taking some time because I want to place it in an isolated network)

            Show
            phunehehe Hoang Xuan Phu added a comment - (I'm preparing the temporary system, but it's taking some time because I want to place it in an isolated network)
            Hide
            phunehehe Hoang Xuan Phu added a comment -

            Elena Stepanova, I have sent an email to the address in your profile with details of the system. Thanks.

            Show
            phunehehe Hoang Xuan Phu added a comment - Elena Stepanova , I have sent an email to the address in your profile with details of the system. Thanks.
            Hide
            elenst Elena Stepanova added a comment - - edited

            Hoang Xuan Phu, thanks a lot for providing the environment, I got what I needed, you can remove my keys now.

            The problem is only remotely related to the angel process or other nested watchdogs/wrappers. One is important though. Among other things, it does

            if [ ! -t 1 ]; then
              exec 0>&-
            ...
            fi
            

            That is, it closes the input.
            On some reason, together with binary log enabled, it causes the crash.

            Note: In fact, there are at least three problems caused by this stdin redirection: if binary log is not enabled, either InnoDB or Aria throws errors about bad file descriptors. Aria does it on shutdown, while InnoDB might do it on startup and fail to start. Because of that, I am not sure how important it is to fix the issue with binary logging only, although it would be nice if it did something more elegant than crash.

            To reproduce, start the server as

            # Assuming BASEDIR is already set to a correct value
            0>&- $BASEDIR/sql/mysqld --no-defaults --basedir=$BASEDIR --datadir=$BASEDIR/data  --loose-lc-messages-dir=$BASEDIR/sql/share --log-bin
            

            wait until it starts and then shut it down.

            #3  <signal handler called>
            #4  0x000000000094ae73 in MYSQL_BIN_LOG::close (this=0x18a2bc0, exiting=5) at 10.0/sql/log.cc:7843
            #5  0x000000000093f95f in MYSQL_BIN_LOG::cleanup (this=0x18a2bc0) at 10.0/sql/log.cc:3100
            #6  0x00000000005bf4aa in clean_up (print_message=true) at 10.0/sql/mysqld.cc:2007
            #7  0x00000000005bf2c2 in unireg_end () at 10.0/sql/mysqld.cc:1936
            #8  0x00000000005bf1e4 in kill_server (sig_ptr=0x0) at 10.0/sql/mysqld.cc:1864
            #9  0x00000000005bf201 in kill_server_thread (arg=0x7f30b5e56e78) at 10.0/sql/mysqld.cc:1887
            #10 0x00007f30b5a90b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
            #11 0x00007f30b3d4695d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
            

            Could only reproduce the crash on 10.0.

            Show
            elenst Elena Stepanova added a comment - - edited Hoang Xuan Phu , thanks a lot for providing the environment, I got what I needed, you can remove my keys now. The problem is only remotely related to the angel process or other nested watchdogs/wrappers. One is important though. Among other things, it does if [ ! -t 1 ]; then exec 0>&- ... fi That is, it closes the input. On some reason, together with binary log enabled, it causes the crash. Note: In fact, there are at least three problems caused by this stdin redirection: if binary log is not enabled, either InnoDB or Aria throws errors about bad file descriptors. Aria does it on shutdown, while InnoDB might do it on startup and fail to start. Because of that, I am not sure how important it is to fix the issue with binary logging only, although it would be nice if it did something more elegant than crash. To reproduce, start the server as # Assuming BASEDIR is already set to a correct value 0>&- $BASEDIR/sql/mysqld --no-defaults --basedir=$BASEDIR --datadir=$BASEDIR/data --loose-lc-messages-dir=$BASEDIR/sql/share --log-bin wait until it starts and then shut it down. #3 <signal handler called> #4 0x000000000094ae73 in MYSQL_BIN_LOG::close (this=0x18a2bc0, exiting=5) at 10.0/sql/log.cc:7843 #5 0x000000000093f95f in MYSQL_BIN_LOG::cleanup (this=0x18a2bc0) at 10.0/sql/log.cc:3100 #6 0x00000000005bf4aa in clean_up (print_message=true) at 10.0/sql/mysqld.cc:2007 #7 0x00000000005bf2c2 in unireg_end () at 10.0/sql/mysqld.cc:1936 #8 0x00000000005bf1e4 in kill_server (sig_ptr=0x0) at 10.0/sql/mysqld.cc:1864 #9 0x00000000005bf201 in kill_server_thread (arg=0x7f30b5e56e78) at 10.0/sql/mysqld.cc:1887 #10 0x00007f30b5a90b50 in start_thread (arg=<optimized out>) at pthread_create.c:304 #11 0x00007f30b3d4695d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112 Could only reproduce the crash on 10.0.
            Hide
            phunehehe Hoang Xuan Phu added a comment -

            Elena Stepanova that was fantastic!

            Show
            phunehehe Hoang Xuan Phu added a comment - Elena Stepanova that was fantastic!

              People

              • Assignee:
                svoj Sergey Vojtovich
                Reporter:
                phunehehe Hoang Xuan Phu
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: