besu
besu copied to clipboard
Warning about missing 'libjemalloc.so' with 22.7.0-RC3 on Ubuntu 22.04 server
Description
As a user of Besu, I don't expect to see any error message when starting Besu so that I have a high confidence about my usage of this software.
Acceptance Criteria
- No error message is shown when starting Besu.
Steps to Reproduce (Bug)
- Download Besu 22.7.0-RC3 on Ubuntu 22.04 server
- Install libjemalloc with
sudo apt install libjemalloc2 - Install Eclipse Tumerin JDK from Adoptium
- Start besu with
bin/besu --version - Notice the following error message:
ERROR: ld.so: object 'libjemalloc.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Expected behavior: No error message is shown when starting Besu.
Actual behavior: The following error message is shown when starting besu: ERROR: ld.so: object 'libjemalloc.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Frequency: 100% of the time
Versions (Add all that apply)
- Software version:
besu/v22.7.0-RC3/linux-x86_64/openjdk-java-17 - Java version:
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode, sharing)
- OS Name & Version:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04 LTS"
PRETTY_NAME="Ubuntu 22.04 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
- Kernel Version:
Linux ubuntu-serser-2204 5.15.0-43-generic #46-Ubuntu SMP Tue Jul 12 10:30:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux - Virtual Machine software & version: VMware® Workstation 16 Player (16.2.4 build-20089737)
Temporary solution
I edited /bin/besu and replaced the LD_PRELOAD line with: export LD_PRELOAD=libjemalloc.so.2 and it fixed my issue. This might be a naming thing on Ubuntu as the libjemalloc is installed in /usr/lib/x86_64-linux-gnu/libjemalloc.so.2.
Other more elegant solutions might involve using a symlink as part of the installation on Ubuntu or rewriting that unixStartScript to account for different libjemalloc names.
Related
PR who introduced this change: #4126 Author of this change: @garyschulte Reviewer: @jflo
@remyroy Could you try to install libjemalloc-dev? We use that one in the docker images and don't see any error message.
It seems like installing the libjemalloc-dev package also installs the libjemalloc2 package and it creates the required symlink on Ubuntu 22.04.
$ ls -al /usr/lib/x86_64-linux-gnu/libjemalloc*
-rw-r--r-- 1 root root 1119814 Jan 24 2022 /usr/lib/x86_64-linux-gnu/libjemalloc.a
-rw-r--r-- 1 root root 1119970 Jan 24 2022 /usr/lib/x86_64-linux-gnu/libjemalloc_pic.a
lrwxrwxrwx 1 root root 16 Jan 24 2022 /usr/lib/x86_64-linux-gnu/libjemalloc.so -> libjemalloc.so.2
-rw-r--r-- 1 root root 744440 Jan 24 2022 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
It also fixes this issue. This can be closed.
I think we are going to keep this issue open and use it to track a better UX for this error. The benefits of using jemalloc are substantial, so it is worth a better and more actionable error.
Hi docs team - please ping me when you pick this up