Signal 6 (SIGABRT), code -1 when executing packed Aarch64 ELF object
This issue tracker is ONLY used for reporting bugs. Please use stackoverflow for supporting issues.
What's the problem (or question)?
UPX 5.1.0 and upx/upx@7ef3e9e5e06f6b1d73b961f1941e0b584c930d32 perform the compression process and the ELF object gets packed. However, the resulting ELF object will crash when loaded. UPX unpacking command outputs a file of the same size but not identical to the one that was originally compressed (mismatching hashes). This crash is also replicable in emulator environments. Crash happens even when using -v1 compression level instead of --best. I had assumed this was related to a different issue described in #18916, but turns out it wasn't. My apologies.
Here are the crashlogs when running the upx/upx@7ef3e9e5e06f6b1d73b961f1941e0b584c930d32 packed ELF (the 5.1.0 logs very similar): CRASH E signal 6 (SIGABRT), code -1 (?), fault addr -------- CRASH E x0 0000000000000000 x1 0000000000007c0b x2 0000000000000006 x3 00000077cd9e0d60 CRASH E x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 0000000000000000 CRASH E x8 00000000000000f0 x9 000000791b2d8de8 x10 0000000000000001 x11 000000791b354bf0 CRASH E x12 000000780e0669fc x13 0000000000000000 x14 0000000000000001 x15 0000080000000000 CRASH E x16 000000791b3c39f8 x17 000000791b39d500 x18 b4000078087789df x19 0000000000007bb8 CRASH E x20 0000000000007c0b x21 00000000ffffffff x22 b4000077cef33840 x23 ffffffffffffd8f0 CRASH E x24 0000007802b0ece8 x25 b4000077ce533730 x26 00000077cd9e1f80 x27 0000007802b11368 CRASH E x28 b4000077ce52f4a0 x29 00000077cd9e0de0 x30 000000791b345238 CRASH E sp 00000077cd9e0d40 pc 000000791b345264 pstate 0000000000000000 CRASH E backtrace: CRASH E 00 pc 00000000000005bc [vdso] () CRASH E 01 pc 0000000000046260 /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) CRASH E 02 pc 000000000031fbcc /memfd:upx (deleted) () CRASH E 03 pc 0000000000319448 /memfd:upx (deleted) () CRASH E 04 pc 00000000003194b4 /memfd:upx (deleted) () CRASH E 05 pc 00000000003195f0 /memfd:upx (deleted) () CRASH E 06 pc 00000000002dd1bc /memfd:upx (deleted) () CRASH E 07 pc 00000000021626e0 /memfd:upx (deleted) ()
What should have happened?
The resulting packed object should not crash when loaded.
Do you have an idea for a solution?
It was observed in "large" objects (>35 MiB), so maybe file size plays a non-decisive role.
How can we reproduce the issue?
1.Download upx-5.2.2-git-7ef3e9e5e06f and upx-5.1.0-win64 UPX GitHub releases and extract them. 2. Download sample XAPK jp.co.altplus.yuyuyui Ver 3.28.0 from Apkpure or any other Android backups website. 3. Extract the contents inside the .xapk file; there should be 2 apk files, config.arm64_v8a.apk & jp.co.altplus.yuyuyui.apk 4. Extract \lib folder from config.arm64_v8a.apk 5. Run in CMD: .\\upx.exe --verbose "{Path}\lib\arm64-v8a\libil2cpp.so" --android-shlib --best 6. Add the \lib folder into jp.co.altplus.yuyuyui.apk once UPX has finished packing il2cpp.so 7. Zipalign and sign the jp.co.altplus.yuyuyui.apk after adding the \lib folder (https://stackoverflow.com/a/40064149). 8. Install the .apk in an Android Environment. 9. Launch the game and encounter the crash. (Note that the .apk created by skipping step 5 launches fine).
Please tell us details about your environment.
- UPX version used (
upx --version): upx 5.1.0 & 5.2.2-git-7ef3e9e5e06f - Host Operating System and version: Windows 11 Pro 25H2
- Host CPU architecture: x64
- Target Operating System and version: Android 14 1.0.14.0.UCVEUX
- Target CPU architecture: Aarch64
- I'm attaching a .zip with the libil2cpp.so ELF from the XAPK previously mentioned.
- I have not been able to find a "standalone" object with little external dependencies in which this issues are replicable. If I find one I'll make sure to provide it.
Source: upx/upx