BOINC / boinc

Open-source software for volunteer computing and grid computing.
https://boinc.berkeley.edu
GNU Lesser General Public License v3.0
2.03k stars 449 forks source link

[Android] aarch64 client requests aarch32 app version even when CPU and project don't support it #5833

Open brevilo opened 2 months ago

brevilo commented 2 months ago

Describe the bug This seems to indicate that BOINC falls back to arm-android-linux-gnu (aarch32) if a project doesn't support aarch64-android-linux-gnu. Is that correct and always the case? If so, it shouldn't be since as of ARMv9-A aarch32 support is optional and not implemented on the Cortex-A520, for instance.

Steps To Reproduce

  1. Use a device with a Cortex-A520
  2. Attach BOINC to Einstein@Home (supporting arm-android-linux-gnu only)
  3. Receive an aarch32 app
  4. Run into an exec format error (8)

Expected behavior BOINC should not fall back to aarch32 on Cortex-A520

System Information

Additional context

brevilo commented 1 month ago

FYI: the CPU architecture reported by /proc/cpuinfo does not indicate the actual architecture, according to this LKML thread. IOW, the 8 above does not refer to ARMv8 and should thus rather be ignored.

brevilo commented 1 month ago

To make things even worse, we're seeing S24 devices which clearly have ARMv9.2-A cores in them, yet do not support their full instruction set. Looking at the CPU features reveals that they are effectively crippled down to armv8.6-a in case of the S24 Ultra. Interestingly enough BOINC reports ABI: arm64-v8a in host.product_name, which is closer to the truth but not that helpful (there).

brevilo commented 1 month ago

Another related observation: I rebuilt the binary for ARMv8-A since this is the first ISA with AArch64 support and should thus be the lowest common denominator to fix (well, work around) the mess from my previous comment. However, while I could execute the binary on my ARMv8 test device (BOINC 8.0.3, Android 11, AArch64 kernel) directly in an adb shell, it immediately errored out under BOINC's anonymous platform (GitHub wiki entry is broken) with an execv: Exec format error. Back to square one. This doesn't make sense. Even if BOINC would run a AArch32 client for some reason, it should still be able to execv a AArch64 app, no? 🤷‍♂

Can someone confirm that anonymous platform is fully supported by BOINC on Android? Just to exclude the error above being a red herring...