Closed Bug 991055 Opened 11 years ago Closed 5 years ago

Do a CPU check before attempting to load native libraries

Categories

(Firefox for Android Graveyard :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: mfinkle, Unassigned)

Details

Attachments

(2 files)

Problems like those in bug 989787 are forcing us to be more pre-emptive when loading native libraries. We should do a CPU check before loading to verify we have the right ABI for the device's architecture. We could submit Telemetry (as long as that does not require Gecko) and display a message before continuing to let Fennec crash, so we get some kind of report.
From google play, here's the relevant stack: java.lang.UnsatisfiedLinkError: Couldn't load mozglue from loader dalvik.system.PathClassLoader[dexPath=/data/app/org.mozilla.firefox_beta-2.apk,libraryPath=/data/app-lib/org.mozilla.firefox_beta-2]: findLibrary returned null at java.lang.Runtime.loadLibrary(Runtime.java:365) at java.lang.System.loadLibrary(System.java:535) at org.mozilla.gecko.mozglue.GeckoLoader.loadMozGlue(GeckoLoader.java:254) at org.mozilla.gecko.GeckoApplication.onCreate(GeckoApplication.java:98) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1017) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4552) at android.app.ActivityThread.access$1400(ActivityThread.java:150) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1340) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5279) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) at dalvik.system.NativeStart.main(Native Method) And, here's the crashes per device over the last 30 days on Release: by device Galaxy Note 8.0 (kona3g) 220 12.2% Xperia SP (C5303) 185 10.3% Xperia L (C2104) 116 6.4% Xperia T (LT30p) 107 5.9% Galaxy Note 8.0 (konawifi) 102 5.7% Xperia SP (C5302) 80 4.4% Xperia L (C2105) 74 4.1% Xperia V (LT25i) 65 3.6% Xperia SP (C5306) 45 2.5% Xperia Tablet Z (SGP311) 41 2.3% Xperia Z (C6603) 41 2.3% Xperia TX (LT29i) 31 1.7% Xperia Tablet Z (SGP321) 28 1.6% Galaxy S4 (jflte) 25 1.4% Galaxy Grand duos (baffin) 21 1.2% ITP-R208W (rk30sdk) 21 1.2% Galaxy S3 (m0) 21 1.2% SGP312 17 0.9% Vandroid 16 0.9% wing-k70 16 0.9% 97 Titanium HD (A97TIHD) 13 0.7% IdeaTab S6000 (S6000) 12 0.7% Galaxy Note II (t03g) 12 0.7% Xperia ZL (C6502) 12 0.7% Xperia M (C1905) 11 0.6% A110 (s9081) 8 0.4% Galaxy Note 8.0 (konalte) 8 0.4% gs702a 8 0.4% maxx_ax5 8 0.4% nuclear-evb 8 0.4% Galaxy S4 (ja3g) 7 0.4% Desire S (saga) 7 0.4% IdeaTab A3000 (A3000) 7 0.4% Micromax_A101 7 0.4% LIFETAB E10310 (LIFETAB_E10310) 7 0.4% Xperia Z (C6602) 7 0.4% rk2928sdk 7 0.4% Galaxy Tab 10.1 (GT-P7500) 7 0.4% Galaxy S2 Plus (s2vep) 6 0.3% Galaxy Tab3 8.0 (lt01wifi) 6 0.3% Galaxy Tab3 10.1 (santos10wifi) 6 0.3% Galaxy S3 (d2att) 6 0.3% Videocon_A15 6 0.3% Xperia T (LT30a) 6 0.3% HTC One XL (evita) 5 0.3% Galaxy S4 Mini (serranolte) 5 0.3% CINK SLIM (s8073) 5 0.3% A9 5 0.3% Galaxy Tab 8.9 (GT-P7300) 5 0.3% 80 XS (A80XSK) 5 0.3% Galaxy Y (GT-S5360) 5 0.3% ME173X (ME173X) 5 0.3% Xperia ZL (C6503) 5 0.3% Xperia C (C2305) 4 0.2% V7 4 0.2% Galaxy S2 (GT-I9100) 4 0.2% 101 Titanium (A101TI) 4 0.2% 80 Titanium (A80TI) 4 0.2% YPY_AB10DC 4 0.2% tinnoes77_s9050 4 0.2% Galaxy S3 (d2spr) 4 0.2% advan77_3778 4 0.2% A630 4 0.2% V6 3 0.2% TAB R105BK 3 0.2% Galaxy Ace (GT-S5830) 3 0.2% A210 (A210) 3 0.2% bird75_a_6628_ics 3 0.2% bird82_wet_a_jb5 3 0.2% Galaxy S4 (jfltespr) 3 0.2% Galaxy S4 (jflteatt) 3 0.2% Galaxy Tab 8.9 (GT-P7310) 3 0.2% Lenovo S880 (s880_row) 3 0.2% Galaxy Tab2 7.0 (espressowifi) 3 0.2% Galaxy S3 (d2tmo) 3 0.2% G610-U20 (hwG610-U20) 3 0.2% BLU 3 0.2% Sensation 4G (pyramid) 3 0.2% Xperia Tablet Z (SGP351) 3 0.2% Galaxy S3 (d2vzw) 3 0.2% Liquid E2 (C11) 3 0.2% TECNO-F7 3 0.2% Monster M7 Tablet (MONSTERM7) 3 0.2% Desire HD (ace) 3 0.2% NX008HD8G 2 0.1% Galaxy Tab3 10.1 (santos103g) 2 0.1% 3Q 2 0.1% RCA RCT6077W22 (RCT6077W22) 2 0.1% miki75_3770 2 0.1% GamePad (A70GP) 2 0.1% HTC One X (endeavoru) 2 0.1% GT-I9100G (GT-I9100G) 2 0.1% S6000L (S6000L) 2 0.1% cross77_3755 2 0.1% ASUS MeMo Pad ME302C (ME302C) 2 0.1% 97 Cobalt (AC97CO) 2 0.1% SAMBM8001ND 2 0.1% A76 2 0.1% HS-U970 (u970s_export) 2 0.1% Mobiistar Touch S02 2 0.1% ALCATEL ONE TOUCH 7025D (Rav4) 2 0.1% ZTE-SKATE (skate) 2 0.1% bd68_15_nand_gtide_e60_ar 2 0.1% HTC One S (ville) 2 0.1% nuclear-anpei9 2 0.1% PAP5044DUO 2 0.1% bird75_a_gb2 2 0.1% Galaxy S4 Mini (serranods) 2 0.1% fnac_45 2 0.1% XOLO 2 0.1% R819 (R819) 2 0.1% unknown 2 0.1% mw07 2 0.1% rk29sdk 2 0.1% lcsh77_cu_ics2 2 0.1% Galaxy Tab2 10.1 (espresso10wifi) 2 0.1% Galaxy Tab3 7.0 (lt02ltespr) 2 0.1% Galaxy Note (GT-N7000) 2 0.1% crane-evb 2 0.1% Galaxy Tab2 10.1 (espresso10rf) 2 0.1% Galaxy Ace (GT-S5830D) 2 0.1% IRIS455 2 0.1% Spice_Mi-495 1 0.1% XOLOQ1000 1 0.1% P780 (P780_ROW) 1 0.1% miki75_6628_ics2 1 0.1% V8 1 0.1% Aquaris I8 (bq_Aquaris) 1 0.1% AX8RACE_ics 1 0.1% Wildfire S (marvel) 1 0.1% Mediacom 810c XTeam 1 0.1% EG680 (eg980ae) 1 0.1% P780 (P780) 1 0.1% nuclear-kf026 1 0.1% Galaxy S2 (GT-I9100T) 1 0.1% ALLVIEW 1 0.1% g06refe4 1 0.1% Y220 (HWY220-U) 1 0.1% e510 1 0.1% Nextbook Next7P12 (M727MC) 1 0.1% lcsh89_we_jb2 1 0.1% GT-P7500R (GT-P7500R) 1 0.1% Galaxy Mega 6.3 (meliuslte) 1 0.1% crane-a702jh-Starmobil 1 0.1% ODYS_IEOS_QUAD 1 0.1% Galaxy Note2 (t0ltecan) 1 0.1% P5740 1 0.1% Star Trail III (mobiwire_startrail3) 1 0.1% s8070 1 0.1% Galaxy S3 (d2can) 1 0.1% me12 1 0.1% htt77_twn_jb 1 0.1% Essentielb- Black Diamond (bird77_a_cu_ics2) 1 0.1% bq_Aquaris5 1 0.1% ZTE V807 (P177E01) 1 0.1% Lenovo S920_ROW (S920_ROW) 1 0.1% Moto G (falcon_umts) 1 0.1% ZIGO 1 0.1% B1-711 (B1-711) 1 0.1% Galaxy Note2 (t0ltetmo) 1 0.1% Nexus 4 (mako) 1 0.1% fiber-s12squad 1 0.1% Galaxy Note2 (t0lte) 1 0.1% nuclear-a7028 1 0.1% Galaxy Note3 (hltevzw) 1 0.1% Nexus 5 (hammerhead) 1 0.1% FamilyPad 2 (A133FP2) 1 0.1% S5-N 1 0.1% Next7C12F 1 0.1% TECNO-M9 1 0.1% mr706 1 0.1% Galaxy Y (GT-S5360L) 1 0.1% QUANTUM94 1 0.1% MID 1 0.1% ASUS Transformer Pad TF300T (TF300T) 1 0.1% IQ4412 1 0.1% TAB462 1 0.1% Xperia ZR (C5502) 1 0.1% Vonino 1 0.1% PROSCAN PLT1066 / MAG MAGPAD / TEAC TEACTAB / DOPO GS-1008 (MID1005_K) 1 0.1% ZTE N9120 (elden) 1 0.1% G700-U10 (hwG700-U10) 1 0.1% s812b_aquas 1 0.1% S5 1 0.1% DS975 1 0.1% bq_Edison2_QuadCore 1 0.1% LG Optimus One (thunderg) 1 0.1% Galaxy Ace (GT-S5830T) 1 0.1% nuclear-pfdq88c 1 0.1% QMobile 1 0.1% gem10313s 1 0.1% Galaxy Tab2 7.0 (espressorf) 1 0.1% Zeki TBDG1073 (TBDG1073) 1 0.1% nuclear-s7916e 1 0.1% Danew Dslide 1013 (DSlide1013) 1 0.1% ZTE V880E (atlas40) 1 0.1% HTC EVO 4G LTE (jewel) 1 0.1% MachSpeed Trio Stealth_10 Tablet (D_10AL) 1 0.1% s9086b 1 0.1% GENERAL_MOBILE 1 0.1% LG-P720h (cx2) 1 0.1% IRIS504Q 1 0.1% g24refem697 1 0.1% Prestigio 1 0.1% R821 (R821) 1 0.1% ZTE V791 (P175A40) 1 0.1% nuclear_sc3071n_sochip_sc3071n 1 0.1% Venue 8 (yellowtail) 1 0.1% Sirius_QS 1 0.1% T720 (T720) 1 0.1% Digital2 Deluxe (nuclear-D2_Deluxe) 1 0.1% Droid Incredible (inc) 1 0.1% cross77_3776 1 0.1% FP1 1 0.1% Galaxy Tab (GT-P1000) 1 0.1% N850L (seanplus) 1 0.1% ILIUM_S700 1 0.1% C10 1 0.1% Galaxy S3 (m3) 1 0.1% Nexus 7 (flo) 1 0.1% bq_Aquaris57 1 0.1% sm112_otd_w_doogee_r 1 0.1% Philips W536 (Philips_WG-MANTO-RU_B) 1 0.1% galaxysmtd 1 0.1% gplus77_3778 1 0.1% GT-P7510 1 0.1% A97G4 1 0.1% asbis 1 0.1% Galaxy S (SHW-M110S) 1 0.1% Galaxy S (GT-I9003) 1 0.1% keneksi77_3776 1 0.1% COSMOSx2 1 0.1% Galaxy Ace (GT-S5830C) 1 0.1% bq_Aquaris5_HD 1 0.1% A117 1 0.1%
Adding a collection of different types of crashes associated with java.lang.UnsatisfiedLinkError
a couple notes from digging into this. We load mozglue from GeckoApplication, which is before we have a window up, so its too early to show a dialog. Also, both telemetry and crash reporting require native code, so we can't use them to report not being able to load native libraries.
It seems that we'd need to depend on Android to send the crash reports. If we want to catch the java.lang.UnsatisfiedLinkError exception, we could convert it to an exception (or more) of our own creation. We could re-throw that exception, which would show up in the Google Play dev console. If we created several different exceptions, we could create a kind of telemetry to track different situations. What if we created a "WrongArch:x86onARM" or "WrongArch:ARMonX86" and re-threw those exceptions? What other kinds of "checks" would we want?
We might be able to launch the crash reporter with a special intent and have it send a minimal JSON crash report that's good enough for socorro to accept, or just show a message that's better than "Firefox has stopped unexpectedly"
(In reply to Mark Finkle (:mfinkle) from comment #4) > What if we created a "WrongArch:x86onARM" or "WrongArch:ARMonX86" and > re-threw those exceptions? What other kinds of "checks" would we want? "404 native libraries not found"
This gets us to the point where we can show a dialog box. Obviously I need some better text to put in here. It currently has "Bad installation" as the title and "Your installation of Firefox is corrupt, please file a bug at https://bugzilla.mozilla.org so we can diagnose and fix your problem" as the message. We should probably add a button or two. Maybe one to launch another browser with bugzilla? Or maybe bring up a webvite with the same? There should also probably be a "no thanks, close" option.
Assignee: nobody → blassey.bugs
Attachment #8402765 - Flags: feedback?(mark.finkle)
Attachment #8402765 - Flags: feedback?(ibarlow)
Comment on attachment 8402765 [details] [diff] [review] unsatisfied_link.patch We will need to figure out how to best handle the dialog and sending information. I think we should try to do some CPU/Srch checking so we can tell the user (or send the info) about why this is happening. Is it x86 on ARMv7? or something else we could detect?
Attachment #8402765 - Flags: feedback?(mark.finkle) → feedback+
And I think we should try to find ways to actually fix the issue, if possible. Like in bug 990130.
Assignee: lassey → nobody
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INCOMPLETE
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: