Closed Bug 1233412 Opened 4 years ago Closed 4 years ago

crash in android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x2/d=0x7f0100e7 a=-1} at android.content.res.Resources.loadColorStateList(Resources.java)

Categories

(Firefox for Android :: General, defect, critical)

45 Branch
Unspecified
Android
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Firefox 46
Tracking Status
firefox44 --- unaffected
firefox45 + fixed
firefox46 + verified
fennec 45+ ---

People

(Reporter: cos_flaviu, Assigned: alex_johnson)

References

Details

(Keywords: crash, regression, reproducible)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is 
report bp-d2372be7-c928-4b1d-9eb3-946e52151217.
=============================================================

Environment: 
Device: Asus Transformer Pad (Android 4.2.1);
Build: Aurora 45.0a2 (2015-12-17);

Steps to reproduce:
1. Go to Settings -> Clear Private Data;
2. Select any options and tap 'Clear Data';

Expected result:
The selected data is successfully cleared.

Actual result:
Fennec crashes.

Stacktrace:
android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x2/d=0x7f0100e7 a=-1}
	at android.content.res.Resources.loadColorStateList(Resources.java:2074)
	at android.content.res.TypedArray.getColorStateList(TypedArray.java:342)
	at android.widget.TextView.<init>(TextView.java:814)
	at android.widget.Button.<init>(Button.java:107)
	at android.widget.Button.<init>(Button.java:103)
	at java.lang.reflect.Constructor.constructNative(Native Method)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
	at android.view.LayoutInflater.createView(LayoutInflater.java:587)
	at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
	at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
	at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:459)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
	at android.support.design.widget.Snackbar$SnackbarLayout.<init>(Unknown Source)
	at java.lang.reflect.Constructor.constructNative(Native Method)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
	at android.view.LayoutInflater.createView(LayoutInflater.java:587)
	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
	at android.support.design.widget.Snackbar.<init>(Unknown Source)
	at android.support.design.widget.Snackbar.make(Unknown Source)
	at android.support.design.widget.Snackbar.make$349db449(Unknown Source)
	at org.mozilla.gecko.preferences.GeckoPreferences$2.run(GeckoPreferences.java:626)
	at android.os.Handler.handleCallback(Handler.java:725)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:5039)
	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:793)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
	at dalvik.system.NativeStart.main(Native Method)
Keywords: reproducible
Also reproducible with this STR:
1. Go to Settings -> Search;
2. Tap o each search engine and remove them;
3. Tap on the last search engine.

Expected result:
A notification is displayed saying that the last search engine can not be disabled or deleted.

Actual result:
Fennec crashes.

Crash not reproducible on devices running Android Lollipop and Marshmallow.
[Tracking Requested - why for this release]: regression

Flaviu would you check for a regression window? This is reproducible and appears to be new in 45.
tracking-fennec: --- → ?
Flags: needinfo?(flaviu.cos)
Keywords: regression
Regression window:
Last good build: 2015-12-11
First bad build: 2015-12-12

Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=754b4805a65cab4f3aca99899227acc44ba4fb20&tochange=694a530e236564a3d9f4b9fd7d9e96ae782b3a7b


Managed to get this far with inbound regression range until mozregression is giving me an error:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=cb59c073476446b2ebf006b450d9a17d1055315e&tochange=694a530e236564a3d9f4b9fd7d9e96ae782b3a7b
Flags: needinfo?(flaviu.cos)
Sebastian looks like bug 1228414 introduced this crash.
Blocks: 1228414
Flags: needinfo?(s.kaspari)
Talked to Alex on IRC. He wants to take a look. Keeping the NI to check back later.
Assignee: nobody → me
Blocks: 1234462
Comment on attachment 8700925 [details]
MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/28839/diff/1-2/
Did a quick fix here because this is critical.  But, I filed bug 1234462 to create a proper fix or switch entirely to toasts in GeckoPrefs.
Attachment #8700925 - Flags: review?(s.kaspari)
Comment on attachment 8700925 [details]
MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian

https://reviewboard.mozilla.org/r/28839/#review25639

We should take the time to find the cause and fix it in this bug. The bug is critical (We definitely do not want to have this in a release version) but this doesn't mean we need to uppress the error as quickly as possible.

Have you been able to reproduce this issue locally? This does not seem to happen on my N9.

::: mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java:629
(Diff revision 2)
> +                        catch (Exception e) {

I'm not really a fan of catching 'Exception'. This will hide programming errors that should be fixed, like NullPointerException, IndexOutOfBoundsException, ..
No longer blocks: 1234462
Duplicate of this bug: 1234462
Comment on attachment 8700925 [details]
MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian

Yes, I can repro this on a 4.2.2 emulator.  It crashes when the SnackbarLayout is being inflated on the rootview.  I'll need to do more debugging to figure out the exact cause of the issue.
Attachment #8700925 - Attachment is obsolete: true
tracking-fennec: ? → 45+
Comment on attachment 8700925 [details]
MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/28839/diff/2-3/
Attachment #8700925 - Attachment description: MozReview Request: Bug 1233412 - Catch exception and show toast if crashes when showing Snackbars in GeckoPrefs. r?sebastian → MozReview Request: Bug 1233412 - Fixed clear bookmark crash on Jelly Bean. r?sebastian
Attachment #8700925 - Attachment is obsolete: false
Attachment #8700925 - Flags: review?(s.kaspari)
Comment on attachment 8700925 [details]
MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/28839/diff/3-4/
Attachment #8700925 - Attachment description: MozReview Request: Bug 1233412 - Fixed clear bookmark crash on Jelly Bean. r?sebastian → MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean. r?sebastian
Comment on attachment 8700925 [details]
MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian

https://reviewboard.mozilla.org/r/28839/#review25901

Close. ;)

We shouldn't switch the theme of GeckoPreferences at runtime. This might break things that need the different theme. Instead: Do you know what difference between the default theme and Gecko.Preferences is causing this? I assume it's either a style missing in Gecko.Preferences or a style (name) that is defined differently. If we can identify this style then we need to move it to a shared base theme or in the worst case copy it to Gecko.Preferences.
Attachment #8700925 - Flags: review?(s.kaspari)
Attachment #8700925 - Attachment description: MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean. r?sebastian → MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r?sebastian
Attachment #8700925 - Flags: review?(s.kaspari)
Comment on attachment 8700925 [details]
MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/28839/diff/4-5/
The colorAccent was missing from the GeckoPref theme. But have no idea why the crash occurs only on Jellybean.
Status: NEW → ASSIGNED
Recent new crash, tracking it.
Comment on attachment 8700925 [details]
MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian

https://reviewboard.mozilla.org/r/28839/#review26353

Interesting. Patch looks good.
Attachment #8700925 - Flags: review?(s.kaspari) → review+
Comment on attachment 8700925 [details]
MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian

Additionally flagging mcomella for feedback. He probably has the most knowledge about our themes and might have an idea why this is only an issue on Jelly Bean.
Flags: needinfo?(s.kaspari)
Attachment #8700925 - Flags: feedback?(michael.l.comella)
https://reviewboard.mozilla.org/r/28839/#review26415

I don't understand why this is necessary or why this crashes on JB. We use the same styles for ICS up to Lollipop so it's strange this is only an issue on JB. I would say it could have something to do with us not extending AppCompatActivity (bug 1205124) and thus some inconsistencies in the AppCompat set-up, but we don't inherit from AppCompat on v11+ for GeckoPreferences, afaict. Perhaps we're using an AppCompat API in code that's throwing the error?

In any case, once we extend AppCompatActivity everywhere, I expect these inconsistency issues to settle down.

Good sleuthing, Alex.

::: mobile/android/base/resources/values/themes.xml:107
(Diff revision 5)
> +        <item name="colorAccent">@color/action_orange</item>

Add a comment explaining why this is necessary.
Attachment #8700925 - Flags: feedback?(michael.l.comella) → feedback+
Attachment #8700925 - Attachment description: MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r?sebastian → MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r=me
Attachment #8700925 - Flags: feedback+
Comment on attachment 8700925 [details]
MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/28839/diff/5-6/
Comment on attachment 8700925 [details]
MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/28839/diff/6-7/
Attachment #8700925 - Attachment description: MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r=me → MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian
Keywords: checkin-needed
Flaviu, could you verify this once it lands?
Flags: needinfo?(flaviu.cos)
https://hg.mozilla.org/mozilla-central/rev/49093f32f8a9
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 46
Comment on attachment 8700925 [details]
MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian

Approval Request Comment

[Feature/regressing bug #]: Snackbars have been introduced app-wide in 45/Aurora - see bug 1157526 (meta).

[User impact if declined]: On Jelly Bean (4.2/4.3) showing a snackbar inside the settings can crash the app.

[Describe test coverage new/current, TreeHerder]: Manual testing. A path triggering a snackbar in GeckoPreferences is not covered by a UI test. But we should do that. I'll create a follow-up bug.

[Risks and why]: Low - we are adding a style element to the preferences theme. This is only used by snackbars.

[String/UUID change made/needed]: -
Attachment #8700925 - Flags: approval-mozilla-aurora?
Comment on attachment 8700925 [details]
MozReview Request: Bug 1233412 - Fixed GeckoPref crashes on Jelly Bean due to theme missing colorAccent. r+sebastian

Fix a crash, taking it.
Attachment #8700925 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Verified as fixed in build 46.0a1 2016-01-07;
Device: Asus Transformer Pad (Android 4.2.1);
Flags: needinfo?(flaviu.cos)
You need to log in before you can comment on or make changes to this bug.