Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-28057

LD_PRELOAD is hardcoded to x64 on flink-docker

    XMLWordPrintableJSON

Details

    Description

      ARM images are not using jemalloc because LD_PRELOAD is hardcoded to use an x64 path, causing this error:

      ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libjemalloc.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
      

      Right now docker-entrypoint is using this:

      maybe_enable_jemalloc() {
          if [ "${DISABLE_JEMALLOC:-false}" == "false" ]; then
              export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libjemalloc.so
          fi
      }
      

      I propose we use this instead:

      maybe_enable_jemalloc() {
          if [ "${DISABLE_JEMALLOC:-false}" == "false" ]; then
              # Maybe use export LD_PRELOAD=$LD_PRELOAD:/usr/lib/$(uname -i)-linux-gnu/libjemalloc.so
              if [[ `uname -i` == 'aarch64' ]]; then
                  export LD_PRELOAD=$LD_PRELOAD:/usr/lib/aarch64-linux-gnu/libjemalloc.so
              else
                  export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libjemalloc.so
              fi
          fi
      }
      

      https://github.com/apache/flink-docker/pull/117

      Attachments

        Issue Links

          Activity

            People

              nferrario Nicolas Ferrario
              nferrario Nicolas Ferrario
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: