-
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
Building an Aarch64 executable with staticx on CentOS on creates a crashing bootloader #213
Comments
And from my comment in #181 (comment): Using this Dockerfile on a
while running all commands locally on that machine result in a working binary. |
Thanks @JonathonReinhart ! Once I get to test it, I'll update here. |
Hi @JonathonReinhart , took me a while to get back to it but it seems that now another problems exists. These tests are performed on staticx 0.13.8. Running the this Dockerfile on an Aarch64 machine works and produces a binary that runs on the Aarch64 system. Running the same Dockerfile on an x86_64 system with emulation crashes during staticx
Another staticx bug? By the way, I looked back at what I did in Granulate/gprofiler#355 which was my attempt at trying to solve the problem described in this ticket (the backtrace) and in #227, I also encountered the |
Taken from my comment in #181 (comment):
I can confirm that staticx works just fine when running on an Aarch64 machine. As you mentioned, there's no wheel for Aarch64 so it gets built locally.
However, when running the staticx build in a Dockerfile cross-built on x86_64, the resulting binary crashes with SIGSEGV. It runs just fine when I tried it with
gdb
. The stack trace fromgdb
and a core file (generated in a "clean" run) is:Deeming this as some type of heap corruption, I also tried
valgrind
but it runs successfully as well haha. I also tried building the bootloader with-fsanitize=address
but my GCC was too old for that.My suspicion is that something doesn't get emulated correctly and the bootloader is built with semi-correct settings (some parameters still fitting x86_64 and not Aarch64), which results in the corruption.
I might find some time to continue investigating this in the weekend, meanwhile if you have any suggestions where to continue searching, I'd be happy to hear them :)
For reference - I ran my tests basing on the image centos@sha256:43964203bf5d7fe38c6fca6166ac89e4c095e2b0c0a28f6c7c678a1348ddc7fa (installing everything for staticx + latest staticx from pypi)
The text was updated successfully, but these errors were encountered: