Closed Bug 1337318 Opened 7 years ago Closed 7 years ago

Our architecture check does not work reliably

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(firefox57 fixed)

RESOLVED FIXED
Firefox 57
Tracking Status
firefox57 --- fixed

People

(Reporter: sebastian, Assigned: jchen)

References

Details

Attachments

(1 file)

Some time ago we added a check that avoid running an APK that wasn't build for the device's architecture (We saw a lot of crashes when running the ARM apk on an x86 device in compatibility mode):
https://dxr.mozilla.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/HardwareUtils.java?q=path%3AHardwareUtils&redirect_type=single#90-112

This fails at least on my Asus TF103CG: When installing and running the ARM APK then the device will pretend to be an ARM device and we will not detect that this is the "wrong" APK.

For example in bug 1318667 we wrote a patch for affected x86 devices: As soon as one of those devices runs the ARM apk this workaround does not work anymore.
Assignee: nobody → s.kaspari
Status: NEW → ASSIGNED
Ugh. Maybe we should just check /proc/cpuinfo or similar to get the architecture?
Yeah, or maybe CPU_ABI2 is helpful here - or on modern devices SUPPORTED_ABIS[], SUPPORTED_32_BIT_ABIS[], SUPPORTED_64_BIT_ABIS[].
ARM APK on x86 device:
----------------------
CPU_ABI:  armeabi-v7a
CPU_ABI2: armeabi

x86 APK on x86 device:
----------------------
CPU_ABI: x86
CPU_ABI2: armeabi-v7a

SUPPORTED_ABIS, SUPPORTED_32_BIT_ABIS and SUPPORTED_64_BIT_ABIS are not supported on my device (API 19, needs API 21+).

Output from /proc/cpuinfo: https://pastebin.mozilla.org/8977756
Assignee: s.kaspari → nchen
This patch doesn't actually make us detect architectures better, though
I think our detection works well enough already. The patch does make us
always use SUPPORTED_ABIS if available instead of CPU_ABI, which is
deprecated.
Attachment #8895930 - Flags: review?(droeh)
Attachment #8895930 - Flags: review?(droeh) → review+
Pushed by nchen@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/31b5a863aee2
Use SUPPORTED_ABIS if available; r=droeh
https://hg.mozilla.org/mozilla-central/rev/31b5a863aee2
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
This patch doesn't actually solve the issue of this bug?!
Do we still not detect your Asus device? We added some more x86 detection in an ealier bug, but there's probably not much more we can do.
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: