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

Segmentation failure when running mysqladmin -u root -p

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.41, 10.0
    • Fix Version/s: 10.0.18, 10.1.5, 5.5.43
    • Component/s: Scripts & Clients
    • Labels:
      None
    • Environment:
      Linux

      Description

      "mysqladmin" crash on execution of below command:

       # mysqladmin -u root -p
      
       mysqladmin  Ver 9.0 Distrib 5.5.41-MariaDB, for Linux on s390x
       Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
      
       Administration program for the mysqld daemon.
       Usage: mysqladmin [OPTIONS] command command....
      
       Default options are read from the following files in the given order:
       Segmentation fault (core dumped)
      

      This error occurs only when no options is sent with the mysqladmin command.
      If I downgrade mariadb packages to version 5.5.37-1.el7, not getting core dump.

      Version-Release number of selected component (if applicable):
      mariadb-5.5.41-2.el7_0

      How reproducible:
      Always

      Steps to Reproduce:
      1. Install mariadb version 5.5.41-2.el7 packages on system and execute below command:

         # mysqladmin -u root -p
      

      Backtrace from the coredump generated on local test system:

      Using host libthread_db library "/lib64/libthread_db.so.1".
      Core was generated by `mysqladmin -u root -p'.
      Program terminated with signal 11, Segmentation fault.
      #0  0x00007f4cb75224bd in malloc_consolidate (av=av@entry=0x7f4cb7860760 <main_arena>) at malloc.c:4129
      4129		      unlink(av, nextchunk, bck, fwd);
      (gdb) bt
      #0  0x00007f4cb75224bd in malloc_consolidate (av=av@entry=0x7f4cb7860760 <main_arena>) at malloc.c:4129
      #1  0x00007f4cb75230e7 in _int_free (av=0x7f4cb7860760 <main_arena>, p=0x7f4cba6ce8b0, have_lock=0) at malloc.c:4021
      #2  0x00007f4cb8d5da48 in free_root (root=root@entry=0x7fff66a257c0, MyFlags=MyFlags@entry=0) at /usr/src/debug/mariadb-5.5.41/mysys/my_alloc.c:372
      #3  0x00007f4cb8d682bd in my_print_default_files (conf_file=0x7f4cb8d7ff84 "my") at /usr/src/debug/mariadb-5.5.41/mysys/default.c:1075
      #4  0x00007f4cb8d68348 in print_defaults (conf_file=<optimized out>, groups=0x7f4cb91f85e0 <load_default_groups>)
          at /usr/src/debug/mariadb-5.5.41/mysys/default.c:1083
      #5  0x00007f4cb8d37cf7 in usage () at /usr/src/debug/mariadb-5.5.41/client/mysqladmin.cc:1235
      #6  0x00007f4cb8d37ad6 in main (argc=0, argv=0x7f4cba6ce7a0) at /usr/src/debug/mariadb-5.5.41/client/mysqladmin.cc:330
      (gdb)
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              hhorak Honza Horak added a comment -

              This is a proposed patch.
              I think the issue is caused by working with

               temp_argv[-1] 

              item in case argc == 0. The attached patch should hopefully prevent that issue.

              Show
              hhorak Honza Horak added a comment - This is a proposed patch. I think the issue is caused by working with temp_argv[-1] item in case argc == 0. The attached patch should hopefully prevent that issue.
              Hide
              hhorak Honza Horak added a comment -

              10.0.17 is affected as well, even though I didn't see it crash (memory corruption caused probably less damage than in 5.5.x).

              Show
              hhorak Honza Horak added a comment - 10.0.17 is affected as well, even though I didn't see it crash (memory corruption caused probably less damage than in 5.5.x).
              Hide
              hhorak Honza Horak added a comment -

              I've reproduced it on x86_64 as well, it doesn't seem to be specific to s390x.

              Show
              hhorak Honza Horak added a comment - I've reproduced it on x86_64 as well, it doesn't seem to be specific to s390x.
              Hide
              elenst Elena Stepanova added a comment - - edited

              Oh you are right, sorry. I ran mysqladmin -uroot -p and it worked okay, but mysqladmin -u root -p crashes.

              Show
              elenst Elena Stepanova added a comment - - edited Oh you are right, sorry. I ran mysqladmin -uroot -p and it worked okay, but mysqladmin -u root -p crashes.

                People

                • Assignee:
                  serg Sergei Golubchik
                  Reporter:
                  hhorak Honza Horak
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 30 minutes
                    30m