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

garbd binary from linux generic "glibc_214" tarballs segfault with config file

Details

    Description

      When using binary tarballs from mariabd.org on Ubuntu 16.04 garbd from the "glibc_214" tarball crashes when reading options from a config file.

      The garbd binaries from the other two tarballs work fine with the same config file, and all three binaries work fine when passing the same options via command line options directly instead of putting them into a config file.

      Looking further the content of the config file doesn't even really matter, garbd even crashes on an empty config file.

      Core file backtrace:

      (gdb) bt
      #0 0x0000000000434635 in _gnu_cxx::exchange_and_add (_mem=0xfffffffffffffff8, __val=<optimized out>)
      at /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3/ext/atomicity.h:48
      #1 _gnu_cxx::exchange_and_add_dispatch (mem=_mem@entry=0xfffffffffffffff8, __val=-1)
      at /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3/ext/atomicity.h:81
      #2 0x000000000044532c in std::string::Rep::_M_dispose (_a=..., this=0xffffffffffffffe8)
      at /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3/bits/basic_string.h:242
      #3 std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string (this=0x7ffebdb5be20, __in_chrg=<optimized out>)
      at /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3/bits/basic_string.h:536
      #4 boost::program_options::options_description::~options_description (this=0x7ffebdb5be20, __in_chrg=<optimized out>)
      at /usr/local/include/boost/program_options/options_description.hpp:163
      #5 0x0000000000443746 in garb::Config::Config (this=0x7ffebdb5c940, argc=3, argv=0x7ffebdb5d0a8) at garb/garb_config.cpp:157
      #6 0x0000000000435ee8 in garb::main (argc=<optimized out>, argv=<optimized out>) at garb/garb_main.cpp:82
      #7 0x000000000043612d in main (argc=<optimized out>, argv=<optimized out>) at garb/garb_main.cpp:113

      Attachments

        Issue Links

          Activity

            anikitin Andrii Nikitin (Inactive) added a comment - - edited

            It looks parse_config_file() does corrupt memory somehow - I bet it is related to compiler-related issues

            102	        if (!ifs.good())
            (gdb) 
            109	        store(parse_config_file(ifs, config), vm);
            (gdb) 
             
            Hardware watchpoint 4: other.m_caption
             
            Old value = "Other options"
            New value = <error reading variable: Cannot access memory at address 0xffffffffffffffe8>
            0x0000000000547f7d in boost::program_options::basic_parsed_options<char> boost::program_options::parse_config_file<char>(std::basic_istream<char, std::char_traits<char> >&, boost::program_options::options_description const&, bool) ()
            

            anikitin Andrii Nikitin (Inactive) added a comment - - edited It looks parse_config_file() does corrupt memory somehow - I bet it is related to compiler-related issues 102 if (!ifs.good()) (gdb) 109 store(parse_config_file(ifs, config), vm); (gdb)   Hardware watchpoint 4: other.m_caption   Old value = "Other options" New value = <error reading variable: Cannot access memory at address 0xffffffffffffffe8> 0x0000000000547f7d in boost::program_options::basic_parsed_options<char> boost::program_options::parse_config_file<char>(std::basic_istream<char, std::char_traits<char> >&, boost::program_options::options_description const&, bool) ()

            The problem doesn't happen with 10.2.11-glibc_214 packages, probably because libgalera version was upgraded:

            # strings -a mariadb-10.2.10-linux-glibc_214/bin/garbd | grep '25\.3\.2'
            25.3.20
            # strings -a mariadb-10.2.11-linux-glibc_214/bin/garbd | grep '25\.3\.2'
            25.3.22
            

            Or because different compiler was used in 10.2.11

            # strings -a mariadb-10.2.11-linux-glibc_214/bin/garbd | grep "GCC: " | uniq
            GCC: (Debian 4.7.1-2) 4.7.1
            GCC: (Debian 4.7.2-5) 4.7.2
            GCC: (Debian 4.4.7-1) 4.4.7
            # strings -a mariadb-10.2.10-linux-glibc_214/bin/garbd | grep "GCC: " | uniq
            GCC: (GNU) 4.7.3
            GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
            # strings -a mariadb-10.2.9-linux-glibc_214/bin/garbd | grep "GCC: " | uniq
            GCC: (GNU) 4.7.3
            GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
            

            anikitin Andrii Nikitin (Inactive) added a comment - The problem doesn't happen with 10.2.11-glibc_214 packages, probably because libgalera version was upgraded: # strings -a mariadb-10.2.10-linux-glibc_214/bin/garbd | grep '25\.3\.2' 25.3.20 # strings -a mariadb-10.2.11-linux-glibc_214/bin/garbd | grep '25\.3\.2' 25.3.22 Or because different compiler was used in 10.2.11 # strings -a mariadb-10.2.11-linux-glibc_214/bin/garbd | grep "GCC: " | uniq GCC: (Debian 4.7.1-2) 4.7.1 GCC: (Debian 4.7.2-5) 4.7.2 GCC: (Debian 4.4.7-1) 4.4.7 # strings -a mariadb-10.2.10-linux-glibc_214/bin/garbd | grep "GCC: " | uniq GCC: (GNU) 4.7.3 GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 # strings -a mariadb-10.2.9-linux-glibc_214/bin/garbd | grep "GCC: " | uniq GCC: (GNU) 4.7.3 GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

            Closing as fixed in 10.2.11 based on the comment above. Please comment if you still experience the problem with 10.2.11+.

            elenst Elena Stepanova added a comment - Closing as fixed in 10.2.11 based on the comment above. Please comment if you still experience the problem with 10.2.11+.

            People

              Unassigned Unassigned
              hholzgra Hartmut Holzgraefe
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.