-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
ELF load command address/offset not properly aligned #492
Comments
Same here with ManyLinux containers that are based on AlmaLinux. 0.17.2.1 works, but 0.18 causes "ELF load command address/offset not properly aligned" |
We changed some alignment stuff in #475 to fix alignment on arm. Looks like this can cause regressions with older glibc versions? |
It's not trivial, but VTK's CI has been affected by this. It's not trivial, but everything is in CI here: https://gitlab.kitware.com/vtk/vtk/-/jobs/8115134. The only difference that is meaningful to the error (to a first approximation) is a IIUC, I suspect just getting any old project that compiles C or C++ code, uses some "weird" external library, and puts that into a wheel using |
We ran into this with |
It looks like in #494 it's only breaking on arm64/s390x for centos. What cpu arch are you on? |
@Mic92, I saw the issue on x86_64. With #494, it just means that there are no tests that show the specific issue just now (or they only appear on arm64/s390x for some reason in the tests). #494 is meant for regressions not to be introduced once this issue is fixed (& a test added) since it only happens with some distros. |
Ubuntu 18.04 x86_64 fails with the same message in multiple tests: https://github.com/NixOS/patchelf/actions/runs/4845550763/jobs/8634531910 |
This issue has broken conda-build for me, which I guess is calling patchelf? I'm on a centos x86_64 machine. |
Yep, we're also seeing failures here in |
It's hard to reproduce this issue, but I have seen the
|
To add some complexity, I think Apple's Rosetta 2 has some differences from Linux/glibc wrt ELF interpretation — so if you're executing patchelf'd amd64 Linux binaries under macOS Docker on Apple Silicon (where amd64 ELF binaries are executed/translated by Rosetta 2 using binfmts); you may see different behaviours than a native amd64 Linux OS. In particular, we've seen some weird issues: segfaults; or messing up dynamic libraries: trying to load |
Issue 100% reproducible in unit tests when running under Rocky 8 docker:
Example output (partial):
|
I'm also seeing mkfs.ext4 segfaults after calling patchelf --set-interpreter multiple times with 0.18.0 version (while 0.17.2 version worked fine), I've uploaded simple reproducer test here: Reverting 65cdee9 fixes this test. |
I'll be able to look into these next week. With a reproducer it should be quick to debug! |
When used to set RPATHS (e.g. installing nvhpc, intel oneapi, cray-mpich): ELF load command address/offset not properly aligned c.f. NixOS/patchelf#492
When used to set RPATHS (e.g. installing nvhpc, intel oneapi, cray-mpich): ELF load command address/offset not properly aligned c.f. NixOS/patchelf#492
:Release Notes: mke2fs.real, mkfs.ext2.real, mkfs.ext3.real, mkfs.ext4.real are indentical binary with multiple hardlinks and we end calling patchelf-uninative 4 times even when the interpreter is already set correctly from the build :Detailed Notes: To avoid corrupted binaries created on 18.04 ubuntu avoid calling patchelf-uninative multiple times and in this case don't call it at all. It might be related to: NixOS/patchelf#492 or NixOS/patchelf#446 but the later was already included in patchelf-0.17.2 used in uninative-3.9 This was submitted to upstream in: https://lists.openembedded.org/g/openembedded-core/message/183314 but wasn't merged yet (so it cannot be in meta-webos-backports-* layer) and it might take a while until it's backported to kirkstone. :Testing Performed: Only build tested. :QA Notes: No change to image. :Issues Addressed: [WRP-19053] CCC: Various build fixes [WRP-17893] mkfs.ext4 segfaults with uninative 3.10 and newer [WRP-6209] Update jenkins slaves to use Ubuntu 20.04 or 22.04 Cherry-picked-from-commit: d3e0606 Cherry-picked-from-branch:
Updating due to a segmentation fault in mkfs.ext4 caused by the patchelf in ubuntu 18.04. Freescale/meta-freescale#1593 NixOS/patchelf#492 (comment) conda-forge/admin-requests#746
* uninative-3.10 and 4.0 doesn't work on e.g. ubuntu-18.04, because patchelf-uninative makes the binaries unusable and e.g. mkfs.ext4 segfaults in loader, see: NixOS/patchelf#492 * mke2fs.real, mkfs.ext2.real, mkfs.ext3.real, mkfs.ext4.real are indentical binary with multiple hardlinks and we end calling patchelf-uninative 4 times even when the interpreter is already set correctly from the build The issue was reported upstream with mkfs.ext4.real as possible reproducer: NixOS/patchelf#492 (comment) To fix uninative we need to first release new uninative tarball and then upgrade it in master, mickledore, kirkstone, dunfell * originally reported in: https://lists.openembedded.org/g/openembedded-core/message/182862 with temporary work around (applicable locally without waiting for new uninative release): https://lists.openembedded.org/g/openembedded-core/message/183314 (From OE-Core rev: f0499b58d1dd149300a349dde8f6664679df13e6) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Workaround for: "error while loading library 'pyprt/lib/libcom.esri.prt.codecs.so': liblzma-51a76f52.so.5.2.4: ELF load command address/offset not properly aligned" Also see NixOS/patchelf#492
Hello all, I see various suggested patches for this issue. Any chance of some combo of them getting merged and a new release being cut, so downstream packagers don't have to worry about this? |
OpenSSL has the configuration option shlib_variant, so we can use that instead. This works for version 1.x and 3.x, so it would make the build script more similar between the two versions. Also, this avoid issues that can come from patchelf, as this patch comes after a bug found in patchelf 0.18 that created wrongly aligned libraries. See NixOS/patchelf#492.
OpenSSL has the configuration option shlib_variant, so we can use that instead. This works for version 1.x and 3.x, so it would make the build script more similar between the two versions. Also, this avoid issues that can come from patchelf, as this patch comes after a bug found in patchelf 0.18 that created wrongly aligned libraries. See NixOS/patchelf#492.
OpenSSL has the configuration option shlib_variant, so we can use that instead. This works for version 1.x and 3.x, so it would make the build script more similar between the two versions. Also, this avoid issues that can come from patchelf, as this patch comes after a bug found in patchelf 0.18 that created wrongly aligned libraries. See NixOS/patchelf#492.
OpenSSL has the configuration option shlib_variant, so we can use that instead. This works for version 1.x and 3.x, so it would make the build script more similar between the two versions. Also, this avoid issues that can come from patchelf, as this patch comes after a bug found in patchelf 0.18 that created wrongly aligned libraries. See NixOS/patchelf#492.
Describe the bug
Once 0.18 release is out, our build process started to fail with
ELF load command address/offset not properly aligned
. We use patchelf inside to add RPATH on Linux systems.On CentOS all our libraries loading started to fail with such error, on Ubuntu 18.04 the issue is reproduced not in all cases (we don't have more details). But on Ubuntu 20.04 we have not seen any regressions.
Expected behavior
Works as before
patchelf --version
output0.18
The text was updated successfully, but these errors were encountered: