besu icon indicating copy to clipboard operation
besu copied to clipboard

Warning about missing 'libjemalloc.so' with 22.7.0-RC3 on Ubuntu 22.04 server

Open remyroy opened this issue 3 years ago • 4 comments

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)

  1. Download Besu 22.7.0-RC3 on Ubuntu 22.04 server
  2. Install libjemalloc with sudo apt install libjemalloc2
  3. Install Eclipse Tumerin JDK from Adoptium
  4. Start besu with bin/besu --version
  5. 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 avatar Jul 28 '22 14:07 remyroy

@remyroy Could you try to install libjemalloc-dev? We use that one in the docker images and don't see any error message.

daniellehrner avatar Jul 28 '22 15:07 daniellehrner

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.

remyroy avatar Jul 28 '22 15:07 remyroy

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.

garyschulte avatar Jul 28 '22 17:07 garyschulte

Hi docs team - please ping me when you pick this up

non-fungible-nelson avatar Aug 01 '22 16:08 non-fungible-nelson