Crash in java.lang.ClassCastException: android.support.v4.app.NoSaveStateFrameLayout at org.mozilla.gecko.GeckoApp.onCreate GeckoApp.java

RESOLVED FIXED in Firefox 53

Status

()

defect
P1
critical
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: ahunt, Assigned: ahunt)

Tracking

({crash})

Trunk
Firefox 54
Points:
---

Firefox Tracking Flags

(fennec52+, firefox51 wontfix, firefox52 wontfix, firefox53 fixed, firefox54 fixed)

Details

(crash signature)

Attachments

(1 attachment)

This the 25th top-crash on release, it seems to be new in 51-release, and I can't see it on any other branches.

This bug was filed from the Socorro interface and is  report bp-8398b3cf-558e-413c-a2b2-ad2f22170201.
Apparently all these crashes are on API 10 (Android 2.3) - we don't actually support that?

Also appears to be happening on an empty line:
https://hg.mozilla.org/releases/mozilla-release/file/tip/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java#l1271
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
Reopening, since we have a suspicion google play is erronously updating people whose phones don't support the latest firefox version. If true, we should add some more version checks on startup.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
tracking-fennec since it looks like users on 2.3 devices are getting Firefox 51 for some reason.
tracking-fennec: --- → ?
That's weird. We should make sure that our builds still have the correct values and we cannot install the APK on Gingerbread devices. If we can't prevent this then we might need to add a SDK level check to our isSupportedSystem() check:
https://dxr.mozilla.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/HardwareUtils.java?q=HardwareUtils.java&redirect_type=direct#82-104
I was going to try and add a better error message - but I'm guessing we'll want to uplift this, so I can't really add any strings.
I'm also wondering if we want a telemetry probe for this - but I'm guessing telemetry won't work if we don't get as far as loading gecko (and we won't get that far if we quit this early).
Attachment #8832717 - Flags: review?(s.kaspari)
(In reply to Andrzej Hunt :ahunt from comment #6)
> I was going to try and add a better error message - but I'm guessing we'll
> want to uplift this, so I can't really add any strings.

You could still change it in Nightly with a second patch though. But there's not much text we can display in a toast. :)

(In reply to Andrzej Hunt :ahunt from comment #7)
> I'm also wondering if we want a telemetry probe for this - but I'm guessing
> telemetry won't work if we don't get as far as loading gecko (and we won't
> get that far if we quit this early).

Yeah, I was thinking that too when seeing this bug - unfortunately you are right: Our (non core ping) telemetry is managed by Gecko.
Comment on attachment 8832717 [details]
Bug 1335968 - Check SDK version at startup

https://reviewboard.mozilla.org/r/108916/#review111508

::: mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/HardwareUtils.java:89
(Diff revision 1)
> +        final boolean isOutdatedSDK = (Build.VERSION.SDK_INT < AppConstants.Versions.MIN_SDK_VERSION);
> +        if (isOutdatedSDK) {
> +            return false;
> +        }

nit: I guess this is still readble as:
> if (Build.VERSION.SDK_INT < AppConstants.Versions.MIN_SDK_VERSION) {

? :)
Attachment #8832717 - Flags: review?(s.kaspari) → review+
Pushed by ahunt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/051a2419f86e
Check SDK version at startup r=sebastian
tracking-fennec: ? → 52+
Priority: -- → P1
We could uplift this, I guess? :)
Assignee: nobody → ahunt
Flags: needinfo?(ahunt)
https://hg.mozilla.org/mozilla-central/rev/051a2419f86e
Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54
Comment on attachment 8832717 [details]
Bug 1335968 - Check SDK version at startup

Approval Request Comment
[Feature/Bug causing the regression]: None - this is a suspected Google Play Store bug.

[User impact if declined]: Startup crash *if* firefox is installed on an outdated device (i.e. unsupported old Android version). We have a suspicion that Google Play is incorrectly updating firefox on unsupported devices (alternatively people are overriding the API check to install Firefox on an unsupported device), those users currently aren't warned that they're on an unsupported device.

[Is this code covered by automated tests?]: No - this only affects unsupported devices, which we don't test on.

[Has the fix been verified in Nightly?]: Unable to verify fix: Android usually prevents installing apps on unsupported operating systems.

[Needs manual test from QE? If yes, steps to reproduce]: n/a.

[List of other uplifts needed for the feature/fix]: none.
[Is the change risky?]: Low risk

[Why is the change risky/not risky?]: We simply refuse to start the app if an unsupported OS version is used. This involves only a simple version number check.

[String changes made/needed]: none.
Flags: needinfo?(ahunt)
Attachment #8832717 - Flags: approval-mozilla-beta?
Attachment #8832717 - Flags: approval-mozilla-aurora?
Comment on attachment 8832717 [details]
Bug 1335968 - Check SDK version at startup

Fix a startup crash by checking SDK version. Aurora53+.
Attachment #8832717 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
https://play.google.com/store/apps/details?id=cn.mozilla.firefox says "requires Android 2.3 and up", vs "4.0.3 and up" for org.mozilla.firefox.  And I'm seeing a lot of CJK characters in soccoro for the reports associated with this bug.  So that might explain what's going on, rather than a play store bug?
(In reply to Julien Cristau [:jcristau] from comment #17)
> https://play.google.com/store/apps/details?id=cn.mozilla.firefox says
> "requires Android 2.3 and up", vs "4.0.3 and up" for org.mozilla.firefox. 
> And I'm seeing a lot of CJK characters in soccoro for the reports associated
> with this bug.  So that might explain what's going on, rather than a play
> store bug?

Bingo!

The play store version claims to be have been last updated on "November 29, 2016" (i.e. well before 51), however the Firefox 51 apk I downloaded from Mozilla China seems to be the culprit:
package: name='org.mozilla.firefox' versionCode='2015470344' versionName='51.0.3' platformBuildVersionName='6.0-2704002'
install-location:'auto'
sdkVersion:'9'
targetSdkVersion:'23'

(sdkVersion:9 == Android 2.3)

APK downloaded from: http://www.firefox.com.cn/#android

I'm able to install that apk on a 2.3 device, and it crashes repeatedly on startup:
https://crash-stats.mozilla.com/report/index/fe7a5e0e-97ef-4b90-8e1e-433812170210
So I'm guessing if they change MIN_SDK_VERSION, the fix in this bug isn't going to work either?
(In reply to Julien Cristau [:jcristau] from comment #19)
> So I'm guessing if they change MIN_SDK_VERSION, the fix in this bug isn't
> going to work either?

Oh, yeah - this patch essentially has no effect :/ .

I'll need to think about this. Ideally they need to _not_ change the sdk version without judicious testing (it's possible the override is unintentional, if they e.g. use an entirely custom AndroidManifest, and forgot to copy the right things over). There's pretty much nothing we can really do to prevent this, short of hardcoding the minsdk where we added the sdk check (but that then means we need to update the check manually, which makes it kindof pointless again).
Attachment #8832717 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
You need to log in before you can comment on or make changes to this bug.