Re: Debian 12.5: pigz 2.6-1 fails with error message (Upstream issue 111)
On Tue, Apr 2, 2024 at 6:24 PM Chung Jonathan <jchung@student.ethz.ch> wrote:
>
> Dear Franco Martelli, dear Thomas Schmitt,
>
> Sorry for the potential duplication. This mail should now also go to the list.
>
> I believe I found the problem which was on my side. I do have libz.so.1.3, since I manually compiled grpc on my machine and this also uses a newer version of zlib appearently. So this is not a Debian problem but rather specific to my setup. A clean install in a VM indeed works as expected.
> Do you still think a bug report is worth it?
Your problem is one that plagues Linux. You compile and link against
one version of a library, and then you runtime link against another
version. This should have been fixed for users a long time ago, but
the folks responsible leave users to suffer it. I consider it a
security bug since essentially random libraries are being loaded at
runtime.
To fix the problem yourself, add an RPATH to your LDFLAGS when
building your program:
-Wl,-rpath=/path/to/expected/libz -Wl,--enable-new-dtags
The loader will encounter the RPATH when loading your executable, and
load the correct library for your program.
Jeff
Reply to: