-
Notifications
You must be signed in to change notification settings - Fork 39
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
Ignore the case where a library symlink has the same basename as its target #225
Conversation
Background: The archive contains a flat collection of all dependent libraries. We also add symlinks as necessary for library versions (e.g. libfoo.so.1 -> libfoo.so.1.2 -> libfoo.so.1.2.3). Problem: The code assumed that a library symlink would only ever point to a library (or another symlink) with a different basename. It did not consider the case where a symlink would point to a library with the same name (but in a different directory). If we would add such a symlink in our flat archive directory, it would be self-referential. The actual crash was a check in the staticx python code, which prevented ELOOP (Too many levels of symbolic links) at runtime. Solution: Skip the creation of any symlinks with the same name as their target, as those are pointless in our flat directory.
Unfortunately this is crashing on Ubuntu:22.04 (the environment referenced in #223), although I think for an unrelated reason:
Building:
Running:
Inspecting
Running under GDB:
Analysis:
Conclusions:
Should pay more attention to this warning:
So what does this mean? Options:
|
After rebuilding the bootloader with musl, The test was successful. This proves that the new crash is unrelated to this fix. I will move the new crash to its own issue. |
Fixes #223
Thanks @liujin1993 for helping to track this down.