[MDEV-24133] Using malloc-lib=jemalloc in MariaDB 10.4.16 breaks startup Created: 2020-11-05  Updated: 2022-02-25  Resolved: 2020-11-05

Status: Closed
Project: MariaDB Server
Component/s: N/A
Affects Version/s: 10.4.16
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Artista Assignee: Anel Husakovic
Resolution: Duplicate Votes: 0
Labels: None
Environment:

CentOS 6.9


Issue Links:
Duplicate
duplicates MDEV-24130 Cannot launch mariadbd via mysqld_safe Closed

 Description   

I was using "malloc-lib=jemalloc" under the mysql_safe section of the my.cnf configuration file in MariaDB 10.4.15 and once I updated to 10.4.16 the startup fails with the following error:

[root@host ~]# service mysql start
Starting MariaDB.201105 05:54:31 mysqld_safe ldconfig command not found, required for ldconfig -p
/etc/init.d/mysql: line 264: kill: (6268) - No such process
ERROR!

I'm running CentOS 6.9 as my operative system and downgrading to MariaDB 10.4.15 immediately resolves this issue.



 Comments   
Comment by Daniel Black [ 2020-11-05 ]

Note that the last release was the last release for Centos/Rhel 6.

MDEV-24130 also includes a my_which -> which typo that it looks like you've got. Changing the script from `my_which` -> `which` should solve the problem for you too.

Comment by Artista [ 2020-11-05 ]

I am aware that it was the last release! Thank you very much, that modification in mysqld_safe does indeed fix the issue!

Comment by Philip orleans [ 2022-02-23 ]

I am struggling to use jemalloc under centos 8, and systemd.
Can somebody be so gentle as to explain how does it need to be implemented?

Comment by Daniel Black [ 2022-02-23 ]

Added it to the documentation in https://mariadb.com/kb/en/systemd/#useful-systemd-options

# systemctl edit mariadb.service
 
[Service]
Environment=LD_PRELOAD=/path/to/jemalloc_lib.so

And then start the service.

Comment by Philip orleans [ 2022-02-24 ]

Ubuntu in all its versions does not load jemalloc from: systemctl edit mariadb.service
it ignores the directive
[service]
Environment=LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2

Centos 8 does work as expected.
In Ubuntu, the only way to do this is to edit
/etc/systemd/system/multi-user.target.wants/mariadb.service
but this means it will not survive a version upgrade.

Comment by Daniel Black [ 2022-02-25 ]

Thanks philip_38 for testing. How odd. I don't have a good explanation for this at the moment.

Generated at Thu Feb 08 09:27:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.