Skip to content

libQt5Core.so corrupted by patchelf #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
schnoberts1 opened this issue Dec 16, 2019 · 3 comments
Closed

libQt5Core.so corrupted by patchelf #187

schnoberts1 opened this issue Dec 16, 2019 · 3 comments

Comments

@schnoberts1
Copy link

schnoberts1 commented Dec 16, 2019

Hi,

I have a repeatable issue (on my machine) that seems to reveal itself with a combination of gcc9 compiled with dualabi enabled and patchelf 0.10 where qt5's uic executable crashes during initialisation. It's worth noting that in this case: the .so does not have an rpath already.

The command I am using is:
patchelf --force-rpath --set-rpath '$ORIGIN/.' libQt5Core.so.5.13.1

Note: --force-rpath is not required to create the issue.

git bisect pinpoints the following commit c4deb5e as being a source of the issue .

I'm no ELF expert and I'm not sure why the above causes the issue so I don't have a patch. I have reverted the change locally and patched up a warning line and it seems to work.

binutils is 2.22

Our gcc/g++ is configured thus:
`list(APPEND GCC_CONFIG --enable-languages=c,c++)

list(APPEND GCC_CONFIG --disable-libstdcxx-pch)

list(APPEND GCC_CONFIG --disable-nls)

list(APPEND GCC_CONFIG --disable-libssp)

list(APPEND GCC_CONFIG --enable-__cxa_atexit)

list(APPEND GCC_CONFIG --with-system-zlib)

list(APPEND GCC_CONFIG --enable-libstdcxx-time=rt)

list(APPEND GCC_CONFIG --with-linker-hash-style=gnu)

list(APPEND GCC_CONFIG --enable-linux-futex=yes)

list(APPEND GCC_CONFIG --enable-libstdcxx-threads)

list(APPEND GCC_CONFIG --disable-libstdcxx-debug)

list(APPEND GCC_CONFIG --enable-libstdcxx-allocator=new)

list(APPEND GCC_CONFIG --disable-multilib)

list(APPEND GCC_CONFIG --enable-lto=yes)`

@schnoberts1
Copy link
Author

schnoberts1 commented Dec 16, 2019

Working version's readelf -d dump
`Dynamic section at offset 0x6263e8 contains 34 entries:
Tag Type Name/Value

0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]

0x0000000000000001 (NEEDED) Shared library: [libz.so.1]

0x0000000000000001 (NEEDED) Shared library: [libdl.so.2]

0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]

0x0000000000000001 (NEEDED) Shared library: [libm.so.6]

0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]

0x0000000000000001 (NEEDED) Shared library: [libc.so.6]

0x0000000000000001 (NEEDED) Shared library: [ld-linux-x86-64.so.2]

0x000000000000000e (SONAME) Library soname: [libQt5Core.so.5]

0x000000000000000c (INIT) 0x86000

0x000000000000000d (FINI) 0x3a7c94

0x0000000000000019 (INIT_ARRAY) 0x61ac28

0x000000000000001b (INIT_ARRAYSZ) 32 (bytes)

0x000000000000001a (FINI_ARRAY) 0x61ac48

0x000000000000001c (FINI_ARRAYSZ) 24 (bytes)

0x000000006ffffef5 (GNU_HASH) 0x2e0

0x0000000000000005 (STRTAB) 0x2db00

0x0000000000000006 (SYMTAB) 0x9068

0x000000000000000a (STRSZ) 231948 (bytes)

0x000000000000000b (SYMENT) 24 (bytes)

0x0000000000000003 (PLTGOT) 0x628000

0x0000000000000002 (PLTRELSZ) 5664 (bytes)

0x0000000000000014 (PLTREL) RELA

0x0000000000000017 (JMPREL) 0x84128

0x0000000000000007 (RELA) 0x69a40

0x0000000000000008 (RELASZ) 108264 (bytes)

0x0000000000000009 (RELAENT) 24 (bytes)

0x000000006ffffffc (VERDEF) 0x695f0

0x000000006ffffffd (VERDEFNUM) 17

0x000000006ffffffe (VERNEED) 0x69840

0x000000006fffffff (VERNEEDNUM) 7

0x000000006ffffff0 (VERSYM) 0x6650c

0x000000006ffffff9 (RELACOUNT) 3567

0x0000000000000000 (NULL) 0x0`

@probonopd
Copy link

probonopd commented Dec 16, 2019

Duplicate of #124 and #110?

@domenkozar
Copy link
Member

Resolved with #202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants