produces broken binary: Inconsistency detected by ld.so [regression gcc-7 7.3.0-15ubuntu2 => 7.3.0-16ubuntu2]

Bug #1764701 reported by Julian Andres Klode on 2018-04-17
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gcc-7 (Ubuntu)
High
Unassigned

Bug Description

The adequate test suite fails because one of the test binaries built cannot be read by ld.so:

Inconsistency detected by ld.so: dl-lookup.c: 111: check_match: Assertion `version->filename == NULL || ! _dl_name_match_p (version->filename, map)' failed!

Test case is to go into tests/testpkg, run

 $PWD/debian/rules clean build

which runs:

cc -shared -Wl,--soname=libadequate-test-versionless.so.0 -Wl,--version-script=verscript-global lib.c -o debian/tmp/libadequate-test-versionless.so.0
ln -sf libadequate-test-versionless.so.0 debian/tmp/libadequate-test-versionless.so
cc undef.c -Ldebian/tmp -o debian/tmp/adequate-test-msvi -ladequate-test-versionless
cc -shared -Wl,--soname=libadequate-test-versionless.so.0 lib.c -o debian/tmp/libadequate-test-versionless.so.0

and then

 LD_LIBRARY_PATH=$PWD/debian/tmp/ ldd -r debian/tmp/adequate-test-msvi

fails with the error. Using gcc-7 7.3.0-15ubuntu2 works, but -16ubuntu2 fails. It's only the library that fails (adequate-test-msvi from 16u2 works fine with LD_LIBRARY_PATH set to 15u2 build, fails with 16u2 LD_LIBRARY_PATH).

Running diffoscope on the libraries (https://jak-linux.org/lib.diff2.html) revealed that 2 sections are missing from the library in 16u2: .gnu_version and .gnu_version_r.

Changed in gcc-7 (Ubuntu):
importance: Undecided → High
summary: - Regression gcc-7 7.3.0-15ubuntu2 => 7.3.0-16ubuntu2
+ produces broken binary: Inconsistency detected by ld.so [regression
+ gcc-7 7.3.0-15ubuntu2 => 7.3.0-16ubuntu2]
Julian Andres Klode (juliank) wrote :

Note that Debian's 7.3.0-16 works fine too.

Julian Andres Klode (juliank) wrote :

Installing 16ubuntu2 in the Debian container makes it fail there too, so it seems highly likely that whatever is different between 16 and 16ubuntu2 is the cause

Julian Andres Klode (juliank) wrote :

Summary of bisecting:

15ubuntu1 good
15ubuntu2 good
16 good
16ubuntu2 bad

Julian Andres Klode (juliank) wrote :

Also:

jak@jak-t480s:~/Projects/Ubuntu/adequate-0.15.1ubuntu5/tests/testpkg$ ldd /home/jak/Projects/Ubuntu/adequate-0.15.1ubuntu5/tests/testpkg/debian/tmp-15u2/libadequate-test-versionless.so.0
        linux-vdso.so.1 (0x00007fff3bbfb000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f92bab2a000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f92bb11d000)
jak@jak-t480s:~/Projects/Ubuntu/adequate-0.15.1ubuntu5/tests/testpkg$ ldd /home/jak/Projects/Ubuntu/adequate-0.15.1ubuntu5/tests/testpkg/debian/tmp-16u2/libadequate-test-versionless.so.0
        statically linked

Matthias Klose (doko) wrote :

there are almost no changes between 16 and 16ubuntu2. Are you sure that 16 is good? There might be a related problem reported as Debian #896012, but that is reported with 16.

Matthias Klose (doko) wrote :

the output of the link command run with -v would probaböy help, as well as the contents of the linker scripts

Matthias Klose (doko) wrote :

there's agcc-7 test build building in ppa:doko/toolchain. please check this as well.

Julian Andres Klode (juliank) wrote :

Here's the output of gcc -v -shared -Wl,--soname=libadequate-test-versionless.so.0 lib.c with the PPA build, does not seem to help.

Julian Andres Klode (juliank) wrote :

Here's the output with 15ubuntu2 which is working.

Julian Andres Klode (juliank) wrote :

The lib.c is just:

void this_symbol_might_be_undefined(void)
{ }

#if !defined(ADEQUATE_SYMBOL_SIZE)
#define ADEQUATE_SYMBOL_SIZE 37
#endif
char this_symbol_size_varies[ADEQUATE_SYMBOL_SIZE];

Julian Andres Klode (juliank) wrote :

the version script is:

ADEQUATE_TEST {
  global: *;
};

and undef.c, which is linked against the first build with versioning is:

extern void this_symbol_might_be_undefined(void);

int main(int argc, char **argv)
{
        this_symbol_might_be_undefined();
        return 0;
}

Julian Andres Klode (juliank) wrote :

But in any case what's broken is the unversioned build - it does not even register as dynamically linked in ldd...

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gcc-7 (Ubuntu):
status: New → Confirmed

i have the same(?) problem in ubuntu 18.10 starting sweethome3d
https://bugs.launchpad.net/ubuntu/+source/sweethome3d/+bug/1797920

I am experiencing this issue when trying to start Terasology with OpenJDK 11.

java --version

openjdk 11.0.1 2018-10-16
OpenJDK Runtime Environment (build 11.0.1+13-Ubuntu-3ubuntu3.18.10.1)
OpenJDK 64-Bit Server VM (build 11.0.1+13-Ubuntu-3ubuntu3.18.10.1, mixed mode, sharing)

Joe (joesalmon1985) wrote :

I also have this problem when trying to run Neuroph, I get the below error

Inconsistency detected by ld.so: dl-lookup.c: 111: check_match: Assertion `version->filename == NULL || ! _dl_name_match_p (version->filename, map)' failed!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments