[Bug 2015748] [NEW] Lib jemalloc building problem

Roberto Acosta 2015748 at bugs.launchpad.net
Mon Apr 10 11:04:51 UTC 2023


Public bug reported:

Hey folks,

I'm trying to build the openvswitch on an Ubuntu jammy (22.04.2 LTS) and
passing the parameter LIBS=-ljemalloc in configure according to the
documentation:
https://readthedocs.org/projects/openvswitch/downloads/pdf/stable/
(Release 3.1.1)

I see the build process using this lib but I don't see the linker step
applying the shared lib in the binary.

...
test -d _debian || mkdir _debian
cd _debian && ( \
	test -e Makefile || \
	../configure --prefix=/usr --localstatedir=/var --enable-ssl LIBS=-ljemalloc \
				 --sysconfdir=/etc \
...

/bin/bash ./libtool  --tag=CC   --mode=link gcc -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-argument -Wbool-compare -Wshift-negative-value -Wduplicated-cond -Wshadow -Wmultistatement-macros -Wcast-align=strict    -g -O2 -ffile-prefix-map=/home/roberto/dev_jammy/network-dev-ovs-ubuntu=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fPIC    -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -o utilities/ovs-appctl utilities/ovs-appctl.o lib/libopenvswitch.la -latomic -lnuma -lbpf -lm -ljemalloc -lunbound -lunwind
...


The binary dependencies are listed below:

dpkg -I ../openvswitch-switch_3.1.0-2_amd64.deb
 new Debian package, version 2.0.
 size 1607488 bytes: control archive=4475 bytes.
      99 bytes,     3 lines      conffiles            
    1300 bytes,    24 lines      control              
    2685 bytes,    37 lines      md5sums              
    5778 bytes,   147 lines   *  postinst             #!/bin/sh
    3599 bytes,   109 lines   *  postrm               #!/bin/sh
    2464 bytes,    65 lines   *  preinst              #!/bin/sh
    1030 bytes,    37 lines   *  prerm                #!/bin/sh
 Package: openvswitch-switch
 Source: openvswitch
 Version: 3.1.0-2
 Architecture: amd64
 Maintainer: Debian OpenStack <team+openstack at tracker.debian.org>
 Installed-Size: 4780
 Pre-Depends: init-system-helpers (>= 1.54~)
 Depends: kmod | module-init-tools, netbase, openvswitch-common (= 3.1.0-2), procps, python3-netifaces, python3-openvswitch (>= 3.1.0-2), uuid-runtime, python3:any, libbpf0 (>= 5.4), libc6 (>= 2.34), libcap-ng0 (>= 0.7.9), libnuma1 (>= 2.0.11), libssl3 (>= 3.0.0~~alpha1), libunbound8 (>= 1.8.0), libunwind8
 Breaks: openvswitch-common (<< 2.17~)
 Replaces: openvswitch-common (<< 2.17~)
 Section: net
 Priority: optional
 Homepage: http://openvswitch.org/
 Description: Open vSwitch switch implementations
  Open vSwitch is a production quality, multilayer, software-based,
  Ethernet virtual switch. It is designed to enable massive network
  automation through programmatic extension, while still supporting
  standard management interfaces and protocols (e.g. NetFlow, IPFIX,
  sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed
  to support distribution across multiple physical servers similar to
  VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V.
  .
  openvswitch-switch provides the userspace components and utilities for
  the Open vSwitch kernel-based switch.
...


I expected to see the link looking at the binary with readelf:

Ubuntu jammy (22.04.2 LTS)

Dynamic section at offset 0x26c348 contains 36 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libssl.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libcap-ng.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libnuma.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libbpf.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libunbound.so.8]
 0x0000000000000001 (NEEDED)             Shared library: [libunwind.so.8]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
 0x000000000000000c (INIT)               0x22000
 0x000000000000000d (FINI)               0x1e7374


If I build the same code base with an Ubuntu Focal, the link with libjemalloc works fine.
e.g. Ubuntu Focal: 20.04 LTS
Dynamic section at offset 0x2c3230 contains 39 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libssl.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libcap-ng.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libnuma.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libbpf.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libjemalloc.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libunbound.so.8]
 0x0000000000000001 (NEEDED)             Shared library: [libunwind.so.8]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
 0x000000000000000c (INIT)               0x27000
 0x000000000000000d (FINI)               0x1fd0c4


Maybe I'm missing something, any idea why I'm not linking?

Kind regards,
Roberto

** Affects: openvswitch (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to openvswitch in Ubuntu.
https://bugs.launchpad.net/bugs/2015748

Title:
  Lib jemalloc building problem

Status in openvswitch package in Ubuntu:
  New

Bug description:
  Hey folks,

  I'm trying to build the openvswitch on an Ubuntu jammy (22.04.2 LTS)
  and passing the parameter LIBS=-ljemalloc in configure according to
  the documentation:
  https://readthedocs.org/projects/openvswitch/downloads/pdf/stable/
  (Release 3.1.1)

  I see the build process using this lib but I don't see the linker step
  applying the shared lib in the binary.

  ...
  test -d _debian || mkdir _debian
  cd _debian && ( \
  	test -e Makefile || \
  	../configure --prefix=/usr --localstatedir=/var --enable-ssl LIBS=-ljemalloc \
  				 --sysconfdir=/etc \
  ...

  /bin/bash ./libtool  --tag=CC   --mode=link gcc -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-argument -Wbool-compare -Wshift-negative-value -Wduplicated-cond -Wshadow -Wmultistatement-macros -Wcast-align=strict    -g -O2 -ffile-prefix-map=/home/roberto/dev_jammy/network-dev-ovs-ubuntu=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fPIC    -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -o utilities/ovs-appctl utilities/ovs-appctl.o lib/libopenvswitch.la -latomic -lnuma -lbpf -lm -ljemalloc -lunbound -lunwind
  ...


  The binary dependencies are listed below:

  dpkg -I ../openvswitch-switch_3.1.0-2_amd64.deb
   new Debian package, version 2.0.
   size 1607488 bytes: control archive=4475 bytes.
        99 bytes,     3 lines      conffiles            
      1300 bytes,    24 lines      control              
      2685 bytes,    37 lines      md5sums              
      5778 bytes,   147 lines   *  postinst             #!/bin/sh
      3599 bytes,   109 lines   *  postrm               #!/bin/sh
      2464 bytes,    65 lines   *  preinst              #!/bin/sh
      1030 bytes,    37 lines   *  prerm                #!/bin/sh
   Package: openvswitch-switch
   Source: openvswitch
   Version: 3.1.0-2
   Architecture: amd64
   Maintainer: Debian OpenStack <team+openstack at tracker.debian.org>
   Installed-Size: 4780
   Pre-Depends: init-system-helpers (>= 1.54~)
   Depends: kmod | module-init-tools, netbase, openvswitch-common (= 3.1.0-2), procps, python3-netifaces, python3-openvswitch (>= 3.1.0-2), uuid-runtime, python3:any, libbpf0 (>= 5.4), libc6 (>= 2.34), libcap-ng0 (>= 0.7.9), libnuma1 (>= 2.0.11), libssl3 (>= 3.0.0~~alpha1), libunbound8 (>= 1.8.0), libunwind8
   Breaks: openvswitch-common (<< 2.17~)
   Replaces: openvswitch-common (<< 2.17~)
   Section: net
   Priority: optional
   Homepage: http://openvswitch.org/
   Description: Open vSwitch switch implementations
    Open vSwitch is a production quality, multilayer, software-based,
    Ethernet virtual switch. It is designed to enable massive network
    automation through programmatic extension, while still supporting
    standard management interfaces and protocols (e.g. NetFlow, IPFIX,
    sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed
    to support distribution across multiple physical servers similar to
    VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V.
    .
    openvswitch-switch provides the userspace components and utilities for
    the Open vSwitch kernel-based switch.
  ...


  
  I expected to see the link looking at the binary with readelf: 

  Ubuntu jammy (22.04.2 LTS)

  Dynamic section at offset 0x26c348 contains 36 entries:
    Tag        Type                         Name/Value
   0x0000000000000001 (NEEDED)             Shared library: [libssl.so.3]
   0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.3]
   0x0000000000000001 (NEEDED)             Shared library: [libcap-ng.so.0]
   0x0000000000000001 (NEEDED)             Shared library: [libnuma.so.1]
   0x0000000000000001 (NEEDED)             Shared library: [libbpf.so.0]
   0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
   0x0000000000000001 (NEEDED)             Shared library: [libunbound.so.8]
   0x0000000000000001 (NEEDED)             Shared library: [libunwind.so.8]
   0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
   0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
   0x000000000000000c (INIT)               0x22000
   0x000000000000000d (FINI)               0x1e7374


  If I build the same code base with an Ubuntu Focal, the link with libjemalloc works fine.
  e.g. Ubuntu Focal: 20.04 LTS
  Dynamic section at offset 0x2c3230 contains 39 entries:
    Tag        Type                         Name/Value
   0x0000000000000001 (NEEDED)             Shared library: [libssl.so.3]
   0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.3]
   0x0000000000000001 (NEEDED)             Shared library: [libcap-ng.so.0]
   0x0000000000000001 (NEEDED)             Shared library: [libnuma.so.1]
   0x0000000000000001 (NEEDED)             Shared library: [libbpf.so.0]
   0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
   0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
   0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
   0x0000000000000001 (NEEDED)             Shared library: [libjemalloc.so.2]
   0x0000000000000001 (NEEDED)             Shared library: [libunbound.so.8]
   0x0000000000000001 (NEEDED)             Shared library: [libunwind.so.8]
   0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
   0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
   0x000000000000000c (INIT)               0x27000
   0x000000000000000d (FINI)               0x1fd0c4

  
  Maybe I'm missing something, any idea why I'm not linking?

  Kind regards,
  Roberto

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openvswitch/+bug/2015748/+subscriptions




More information about the Ubuntu-openstack-bugs mailing list