SonarQube - C++ - Ubuntu - build-wrapper LD_PRELOAD Error


(Stefan) #1

SonarQube Version 7.1 build 11001


docker run -it ubuntu:18.04 bash
apt-get update
apt-get install wget unzip
cd build-wrapper-linux-x86
./build-wrapper-linux-x86-64 --out-dir test ls

ERROR: object '/build-wrapper-linux-x86/libinterceptor-${PLATFORM}.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

Docker images 16.04, 16.10 are working, 17.10, 18.04 are not working. It seems like the build-wrapper is incompatible with the new ubuntu versions.

(Evgeny Mandrikov) #2

There was a regression in glibc library version 2.26 - , which unfortunately affects build-wrapper. From the above ticket regression was fixed in version 2.27.

Unfortunately Ubuntu 17.10 comes with glibc version 2.26 and without patch for the above problem - see => artful-updates ( ) => Ubuntu Changelog ( ).

Ubuntu 18.04 comes with glibc version 2.27 with fix for the above problem - see => bionic ( ). And build-wrapper perfectly works on it:

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ubuntu              18.04               113a43faa138        13 days ago         81.1MB

$ docker run -it --rm ubuntu:18.04 env PS1='(ubuntu:18.04) $ ' sh
(ubuntu:18.04) $ apt-get -qq update
(ubuntu:18.04) $ apt-get -qq -y install wget unzip
(ubuntu:18.04) $ wget -q
(ubuntu:18.04) $ unzip -q
(ubuntu:18.04) $ ./build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir test /bin/echo test

So I think that your test of Ubuntu 18.04 was flawed.

Should be noted that Ubuntu 17 is not an LTS version and will reach EOL in July 2018 - see , and we are not planning to try find a workaround on our side for it.

Also please keep in mind that not always possible to implement workarounds for bugs in third-party components, especially when they are at a such low level - loader of executable files.


SonarQube Version 7.1 build 11001

build-wrapper is part of SonarCFamily Plugin and there is no way to guess their versions from version of SonarQube server. build-wrapper prints its version when executed without parameters:

$ ./build-wrapper-linux-x86/build-wrapper-linux-x86-64
build-wrapper, version 5.1 (linux-x86)

(Stefan) #3

Thanks for your reply, but the problem definitely exists also with ubuntu 18.04. Cleanely pulled the image on 3 computers, on all of them i got the same problem. Even exactly following your steps. Maybe the problem is the host system? Host is Ubuntu 17.10.

(Stefan) #4

Confirm, it works on 16.04 Host system with 18.04 docker container.
Still have the problem on 17.10 and 18.04 host systems with 17.10 or 18.04 docker.
Also still have the same problem on a native ubuntu 18.04 without docker.

Host/Docker 16.10 17.10 18.04
16.04 works works
17.10 works x x
18.04 works x x

(Arnaud Gelas) #5

I have exactly the same problem on Ubuntu 18.04 (LTS).

ERROR: object '/home/agelas/Downloads/sonar/build-wrapper-linux-x86/libinterceptor-${PLATFORM}.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

Here is my configuration:

$ apt-cache policy libc-bin
  Installed: 2.27-3ubuntu1
  Candidate: 2.27-3ubuntu1
  Version table:
 *** 2.27-3ubuntu1 500
        500 bionic/main amd64 Packages
        100 /var/lib/dpkg/status

$ build-wrapper-linux-x86-64 
build-wrapper, version 5.1 (linux-x86)
Copyright (C) 2014-2017 SonarSource SA,

Any idea?

(Evgeny Mandrikov) #6

I just downloaded and installed Ubuntu 18.04 from and build-wrapper works on it:

And in Docker on it:

Furthermore, despite the fact that I strongly believe that we should stop discussing non-LTS-soon-end-of-life version, I downloaded and installed Ubuntu 17.10.1 from and as already explained above - build-wrapper doesn’t work on it. However works in Docker on Ubuntu 17.10.1, what seems quite logical to me - AFAIK Docker container uses host’s kernel, but not loader of executables:

Thus I truly have no idea how we can reproduce your problem. Can you provide exact steps to follow?
And please provide all the output of a tracing of a failing execution as following (directory bw-output and files stdout.txt and stderr.txt):

strace -f -E LD_DEBUG=all ./build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output /bin/echo test >stdout.txt 2>stderr.txt

(Stefan) #7

Strange thing, i did exactly the same, downloaded fresh ubuntu 18.04 from their homepage, plain install, error occures. The only thing i do during install is setting the language to german.

Your requested logs from an Ubuntu 18.04 docker running on a 18.04 host.

stdout.txt (5 Bytes)
stderr.txt (740.7 KB)

And directly executed on the host native ubuntu 18.04 (no docker)

ERROR: object
Sonarqube-developer-7.4: build-wrapper exits unexpecedly with build-wrapper: SQ_WRAPPER_SOCKET is missing
(Evgeny Mandrikov) #8

I also asked directory bw-output, but never mind - here is important traces of a problem from provided logs:

[pid 32712] openat(AT_FDCWD, "/home/jenkins/build-wrapper-linux-x86/", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

Clearly your host architecture is different from mine.

While still should be investigated why previous version of loader of executables works differently on the same host, could you please try following possible workaround:

either copy into

cp ./build-wrapper-linux-x86/ ./build-wrapper-linux-x86/

(make sure to not remove original file)

or create symlink to

ln -s ./build-wrapper-linux-x86/


Sonarqube-developer-7.4: build-wrapper exits unexpecedly with build-wrapper: SQ_WRAPPER_SOCKET is missing
ERROR: object
(Stefan) #9

Great, copying the lib works perfectly! Thank you! :grinning::+1:

(Evgeny Mandrikov) #10

Thank you, Stefan, for helping us to uncover this and confirmation that workaround works :thumbsup: :heart:

Here is a ticket to track future progress on replacement of this workaround with something better -

(Roman Lebedev) #11

FYI debian testing-based docker image + travis-ci with

    dist: trusty	
    sudo: required

appear to also be affected, even though debian testing has libc 2.27.

Changing travis config (as suggested by Travis support) workarounds this:

    sudo: required
    dist: xenial
    edge: true