patchelf icon indicating copy to clipboard operation
patchelf copied to clipboard

Patchelf set-rpath fails on Fedora 41 beta

Open jeremysanders opened this issue 1 year ago • 3 comments
trafficstars

Describe the bug

Executables which have the rpath set give a segfault on the beta Fedora 41.

Steps To Reproduce

Basic hello world

mytest.c:

      #include <stdio.h>
      int main()
      {
           printf("hello, world!\n");
           return 0;
      }
$ gcc -o mytest mytest.c
$ patchelf --set-rpath '/usr/lib' ./mytest
$ ./mytest
Segmentation fault (core dumped)

Please include exact steps with an attached binary so that another person can reproduce the problem.

Expected behavior

Should not fail.

patchelf --version output patchelf 0.18.0

Additional context Originally reported in this Fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=2319341

jeremysanders avatar Oct 23 '24 18:10 jeremysanders

Possibly related is a segmentation fault in a meson-python test that fiddles with rpaths: https://bugzilla.redhat.com/show_bug.cgi?id=2321588, https://github.com/mesonbuild/meson-python/issues/698

musicinmybrain avatar Oct 29 '24 14:10 musicinmybrain

I am not entirely sure the meson-python issue is caused by the same thing. It only now started to happen since this binutils commit: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bf6d7087de0a7351fd1dfd5f41522a7f4f576180

hroncok avatar Oct 30 '24 17:10 hroncok

For the record, this is still an ongoing issue. Would upstream want some help setting up a CI to cover Fedora? In the meantime LIEF also works, but it doesn't have a compatible interface. A compatibility shim can be created though

LecrisUT avatar May 10 '25 12:05 LecrisUT

@LecrisUT LIEF recently announced a drop-in-replacement of patchelf command line utility.

https://lief.re/blog/2025-07-13-patchelf/

igxactly avatar Sep 08 '25 02:09 igxactly