[MDEV-17953] MariaDB 10.2.19 with TokuDB incompatible with Jemalloc 5+ Created: 2018-12-09  Updated: 2018-12-20  Resolved: 2018-12-20

Status: Closed
Project: MariaDB Server
Component/s: Compiling, Packaging
Affects Version/s: 10.2.19
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Ján Regeš Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 0
Labels: jemalloc, tokudb
Environment:

Gentoo Linux


Issue Links:
Relates
relates to MDEV-16183 TokuDB tests fail on Fedora 28 Closed

 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'.



 Comments   
Comment by Sergei Golubchik [ 2018-12-11 ]

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...

Comment by Ján Regeš [ 2018-12-11 ]

Sergei, thank you very much!

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

Comment by Sergei Golubchik [ 2018-12-15 ]

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.

Comment by Sergei Golubchik [ 2018-12-20 ]

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.

Comment by Ján Regeš [ 2018-12-20 ]

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

Generated at Thu Feb 08 08:40:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.