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

MariaDB 10.2.19 with TokuDB incompatible with Jemalloc 5+

Details

    Description

      Hi,

      after update to newer packages in my Gentoo Linux (MariaDB 10.2.19 with TokuDB support and latest Jemalloc 5.1.0), mysql failed to start with error below (cannot allocate memory in static TLS block).

      After downgrade jemalloc to version 4.5.0 it works fine.

      Probably, it's related to MDEV-16183.

      Proposed solution is maybe disabling jemalloc support or mask to jemalloc version under 5?

      Thank you.

      [ERROR] Can't open shared library '/usr/lib64/mariadb/plugin/ha_tokudb.so' (errno: 0, /usr/lib64/libjemalloc.so.2: cannot allocate memory in static TLS block)
      [ERROR] Couldn't load plugins from 'ha_tokudb.so'.

      Attachments

        Issue Links

          Activity

            You're right. It's the same issue as MDEV-16183.

            The thing is, there are, basically, two ways to install MariaDB — RPM/DEB packages, where we know that the run-time configuration won't be much different from the build configuration, and we can install files in /etc. And binary tarballs, that are just unpacked anywhere on the filesystem.

            In the first case we we don't link TokuDB with jemalloc, but preload it with LD_PRELOAD. This needs some changes in files in /etc. In the second case we link with jemalloc statically and our build host uses old jemalloc.

            Gentoo should be more like the first case, but it builds using the bintar way. I'll see what we can do here...

            serg Sergei Golubchik added a comment - You're right. It's the same issue as MDEV-16183 . The thing is, there are, basically, two ways to install MariaDB — RPM/DEB packages, where we know that the run-time configuration won't be much different from the build configuration, and we can install files in /etc . And binary tarballs, that are just unpacked anywhere on the filesystem. In the first case we we don't link TokuDB with jemalloc, but preload it with LD_PRELOAD . This needs some changes in files in /etc . In the second case we link with jemalloc statically and our build host uses old jemalloc. Gentoo should be more like the first case, but it builds using the bintar way. I'll see what we can do here...
            jan.reges Ján Regeš added a comment -

            Sergei, thank you very much!

            Just for now, we'll temporarily mask jemalloc 5+ versions.

            jan.reges Ján Regeš added a comment - Sergei, thank you very much! Just for now, we'll temporarily mask jemalloc 5+ versions.

            grknight, so far as I cannot see a good fix that will work for Gentoo and won't make bintar builds worse for everyone else (normally people build tokudb just in case, and use mysqld_safe or systemd).

            But I see you do this for tcmalloc:

               if use tcmalloc; then
                       echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt"
               fi
            

            You can do the same for jemalloc and it should solve the issue for Gentoo.

            serg Sergei Golubchik added a comment - grknight , so far as I cannot see a good fix that will work for Gentoo and won't make bintar builds worse for everyone else (normally people build tokudb just in case, and use mysqld_safe or systemd). But I see you do this for tcmalloc: if use tcmalloc; then echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" fi You can do the same for jemalloc and it should solve the issue for Gentoo.

            jan.reges, another option that you could is to LD_PRELOAD jemalloc. This will work with jemalloc 5 too. I think that if you set LD_PRELOAD in a /etc/conf.d/ file, it'll affect mysqld just fine.

            serg Sergei Golubchik added a comment - jan.reges , another option that you could is to LD_PRELOAD jemalloc. This will work with jemalloc 5 too. I think that if you set LD_PRELOAD in a /etc/conf.d/ file, it'll affect mysqld just fine.
            jan.reges Ján Regeš added a comment -

            Hi Sergei,

            I reported your solution to Gentoo ticket system: https://bugs.gentoo.org/673470

            Thank you for your time. Merry Christmas and a Happy New Year

            jan.reges Ján Regeš added a comment - Hi Sergei, I reported your solution to Gentoo ticket system: https://bugs.gentoo.org/673470 Thank you for your time. Merry Christmas and a Happy New Year

            People

              serg Sergei Golubchik
              jan.reges Ján Regeš
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.