-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
segfault following assert fail at patchelf.cc:556 #583
Comments
I encountered a similar bug to this, also hitting the assertions in This patch seems to fix this particular issue:
I do not understand patchelf well enough to judge if this is a reasonable fix though. To at least somewhat test this patch I used the following "fuzzing" script using the test binary from this
|
patchelf segfauilts after printing an assertion error message, when applied a particular file, which I will attach. It seems to occur when
--no-default-lib
is used with both-set-interpreter
and--set-rpath
arguments of a certain minimum length.Steps to reproduce
Here is a cut-down test which reproduces on my system (if it doesn't repro for you, please try making the /aaaa... and /bbb... much longer).
/tmp/testprog
is the file I will attach:Here is a gdb backtrace:
Build Version
I compiled patchelf from git source current master, 739a486, using gcc 13.3.0 on Ubuntu 24.04.1 LTS.
The compiled patchelf says it is version 0.18.0
The Test File
This is a copy of /usr/bin/x86_64-linux-gnu-cpp-13 i.e. gcc C Preprocessor executable (which I'm trying to patch to work on another server where I don't have root access to properly install anything...)
[Grumble... github would not let me attach the executable directly; so I put it in a tarball]
testprog.tar.gz
The text was updated successfully, but these errors were encountered: