crash in android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=$ a=3 r=$} at android.content.res.Resources.loadDrawable(Resources.java)

VERIFIED FIXED in Firefox 33

Status

()

defect
--
critical
VERIFIED FIXED
5 years ago
5 years ago

People

(Reporter: aaronmt, Assigned: bnicholson)

Tracking

({crash})

33 Branch
Firefox 35
All
Android
Points:
---
Bug Flags:
qe-verify -

Firefox Tracking Flags

(firefox32 wontfix, firefox33+ verified, firefox34+ verified, firefox35 verified, fennec+)

Details

(Whiteboard: [GT-P6200][GT-P6800], crash signature)

Attachments

(3 attachments)

This bug was filed from the Socorro interface and is 
report bp-640c28d7-47b5-45c2-8414-4165d2140910.
=============================================================

android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f070126 a=3 r=0x7f070126}
	at android.content.res.Resources.loadDrawable(Resources.java:1890)
	at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
	at android.view.View.<init>(View.java:2471)
	at android.view.ViewGroup.<init>(ViewGroup.java:365)
	at android.widget.LinearLayout.<init>(LinearLayout.java:156)
	at android.widget.LinearLayout.<init>(LinearLayout.java:152)
	at java.lang.reflect.Constructor.constructNative(Native Method)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:416)
	at android.view.LayoutInflater.createView(LayoutInflater.java:576)
	at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
	at android.view.LayoutInflater.onCreateView(LayoutInflater.java:644)
	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:457)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:347)
	at android.widget.Toast.makeText(Toast.java:247)
	at android.widget.Toast.makeText(Toast.java:270)
	at android.sec.clipboard.ClipboardExManager$1.handleMessage(ClipboardExManager.java:100)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:132)
	at android.app.ActivityThread.main(ActivityThread.java:4123)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:491)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
	at dalvik.system.NativeStart.main(Native Method)

Still crashing for the GT-P6200 device on 33+
I finally got my hands on this tablet last week, but it's ICS, not Honeycomb. I'll see if I can root/downgrade it.
Assignee: nobody → bnicholson
Looking through reports, we trigger this -- a great deal -- at http://mxr.mozilla.org/mozilla-release/source/mobile/android/base/GeckoApp.java#782.  It's just showing a toast; there's no Fennec resources involved.  The best we can do is try something else on these devices, to avoid the crash.

This is ridiculous.
Did something regress from the fixes that were proposed and landed in bug 970081?
See https://bugzilla.mozilla.org/show_bug.cgi?id=987864#c4. Although it changes, the resource ID always ends up pointing to org.mozilla.firefox:style/GeckoActionBar.Title, so I still think this could be our fault.
bnicholson: I was not aware our styling could affect system toasts at all.  Can you take this ticket and repeat your investigation here?
Flags: needinfo?(bnicholson)
(In reply to Nick Alexander :nalexander from comment #6)
> bnicholson: I was not aware our styling could affect system toasts at all. 
> Can you take this ticket and repeat your investigation here?

I'm also not sure whether it can, but the fact that the referenced resource is always the same seems suspicious. I at least want to reproduce to see if that reveals anything.

Already assigned myself!
Flags: needinfo?(bnicholson)
(In reply to Nick Alexander :nalexander from comment #6)
> bnicholson: I was not aware our styling could affect system toasts at all. 
> Can you take this ticket and repeat your investigation here?

I'll look a little, too.  Fetching

http://ftp.mozilla.org/pub/mozilla.org/mobile/releases/latest-beta/android/multi/fennec-33.0b2.multi.android-arm.apk

Running

aapt l -a fennec-33.0b2.multi.android-arm.apk | grep 0x7f070126

yields

      spec resource 0x7f070126 org.mozilla.firefox_beta:style/GeckoActionBar: flags=0x00000400
        resource 0x7f070126 org.mozilla.firefox_beta:style/GeckoActionBar: <bag>
        resource 0x7f070126 org.mozilla.firefox_beta:style/GeckoActionBar: <bag>

I bet we have the same issue as before.
(In reply to Nick Alexander :nalexander from comment #8)
> (In reply to Nick Alexander :nalexander from comment #6)
> > bnicholson: I was not aware our styling could affect system toasts at all. 
> > Can you take this ticket and repeat your investigation here?
> 
> I'll look a little, too.  Fetching
> 
> http://ftp.mozilla.org/pub/mozilla.org/mobile/releases/latest-beta/android/
> multi/fennec-33.0b2.multi.android-arm.apk
> 
> Running
> 
> aapt l -a fennec-33.0b2.multi.android-arm.apk | grep 0x7f070126
> 
> yields
> 
>       spec resource 0x7f070126
> org.mozilla.firefox_beta:style/GeckoActionBar: flags=0x00000400
>         resource 0x7f070126 org.mozilla.firefox_beta:style/GeckoActionBar:
> <bag>
>         resource 0x7f070126 org.mozilla.firefox_beta:style/GeckoActionBar:
> <bag>
> 
> I bet we have the same issue as before.

GeckoActionBar is defined at

http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/resources/values-v11/styles.xml#79

as

79     <style name="GeckoActionBar" parent="@android:style/Widget.Holo.Light.ActionMode">
80         <item name="android:background">@drawable/ab_stacked_transparent_light_holo</item>
81     </style>

Widget.Holo.Light.ActionMode is defined at:

http://androidxref.com/4.4.4_r1/xref/frameworks/base/core/res/res/values/styles.xml?a=true&h=2309

A wrinkle: it looks like this is actually a v11 thing:

http://developer.android.com/reference/android/R.style.html#Widget_Holo_Light_ActionBar
https://developer.android.com/reference/android/R.style.html#TextAppearance_Holo_Widget_ActionBar_Title
= v13

mobile/android/base/resources/values-v11/styles.xml
83:    <style name="TextAppearance.Widget.ActionBar.Title" parent="@android:style/TextAppearance.Medium"/>
85:    <style name="GeckoActionBar.Title" parent="TextAppearance.Widget.ActionBar.Title">

mobile/android/base/resources/values-v13/styles.xml
13:    <style name="TextAppearance.Widget.ActionBar.Title" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title"/>


which looks fine, but we definitely have a bug in Sync (v11 referring to a v13 thang):

mobile/android/base/resources/values-v11/sync_styles.xml
9:    <item name="android:textAppearance">@android:style/TextAppearance.Holo.Widget.ActionBar.Title</item>
tracking-fennec: ? → +
Simply reorders theme styles alphabetically.
Attachment #8492849 - Flags: review?(lucasr.at.mozilla)
Uses inheritance for Gecko.App to avoid some duplication. Creates GeckoAppBase as the parent for Gecko.App (similar to our GeckoBase/Gecko inheritance), where Gecko.App contains shared styles and GeckoAppBase can be overridden at each API level.

The third patch here will introduce a values-v14 where all of the values-v11 styles will be the same, except for two additional styles. That means these all of the values-v11 styles will still be duplicated in values-v14. We could be a more clever about this if we wanted to; for example, we could have GeckoAppBase be the shared set of styles (rather than Gecko.App), and the hierarchy could look something like this:

res/values/themes.xml:
    <style name="GeckoAppBase" parent="Gecko">
        <!-- all shared styles go here -->
    </style>
    <style name="Gecko.App" parent="GeckoAppBase">
        <!-- these will be overridden -->
    </style>

res/values-v11/themes.xml:
    <style name="GeckoAppBase.v11">
        <!-- all shared original and v11+ styles go here -->
    </style>
    <style name="Gecko.App" parent="GeckoAppBase.v11"/>

res/values-v14/themes.xml:
    <style name="GeckoAppBase.v11.v14">
        <!-- all shared original, v11+, and v14+ styles go here -->
    </style>
    <style name="Gecko.App" parent="GeckoAppBase.v14"/>

This would remove any style duplication, but I think it's inconsistent with how styles are normally structured. But I'd be fine with this inheritance model instead if you prefer it.
Attachment #8492851 - Flags: review?(lucasr.at.mozilla)
Here's the actual fix. I was finally able to downgrade my GT-P6200 to 3.2, reproduced the crash, then narrowed down the broken styles. actionModeStyle and actionModeSelectAllDrawable are both v14+, so we need to move them out of v11. I can confirm that this patch fixes the crash.
Attachment #8492852 - Flags: review?(lucasr.at.mozilla)
(In reply to Brian Nicholson (:bnicholson) from comment #12)
>     <style name="GeckoAppBase.v11">
>         <!-- all shared original and v11+ styles go here -->

This comment was confusing, so just to be clear: what I really meant was that only the v11 styles would go here, and the original styles would be inherited from GeckoAppBase. Same correction for GeckoAppBase.v11.v14: only the v14 styles would go there, and the original/v11 styles would be inherited.
Duplicate of this bug: 1043116
Comment on attachment 8492849 [details] [diff] [review]
Alphabetize theme styles

Review of attachment 8492849 [details] [diff] [review]:
-----------------------------------------------------------------

OCD much? ;-)
Attachment #8492849 - Flags: review?(lucasr.at.mozilla) → review+
Attachment #8492851 - Flags: review?(lucasr.at.mozilla) → review+
Comment on attachment 8492852 [details] [diff] [review]
Add values-v14, removing v14-only styles from values-v11

Review of attachment 8492852 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me.
Attachment #8492852 - Flags: review?(lucasr.at.mozilla) → review+
Marking affected versions -- we should get this uplifted.
[Tracking Requested - why for this release]: Patch available for common crash on two Samsung devices.
Brian, can we get uplift requests for aurora & beta? thanks
Flags: needinfo?(bnicholson)
Comment on attachment 8492849 [details] [diff] [review]
Alphabetize theme styles

Approval Request Comment
[Feature/regressing bug #]: N/A
[User impact if declined]: Honeycomb devices crash frequently.
[Describe test coverage new/current, TBPL]: No tests, but got my hands on crashing device and verified that crash is fixed.
[Risks and why]: Very low risk. We had v14 styles in our v11 folder, which is invalid. This fixes them by moving them into the v14 folder.
[String/UUID change made/needed]: None
Attachment #8492849 - Flags: approval-mozilla-beta?
Attachment #8492849 - Flags: approval-mozilla-aurora?
Flags: needinfo?(bnicholson)
Attachment #8492851 - Flags: approval-mozilla-beta?
Attachment #8492851 - Flags: approval-mozilla-aurora?
Attachment #8492852 - Flags: approval-mozilla-beta?
Attachment #8492852 - Flags: approval-mozilla-aurora?
Attachment #8492849 - Flags: approval-mozilla-beta?
Attachment #8492849 - Flags: approval-mozilla-beta+
Attachment #8492849 - Flags: approval-mozilla-aurora?
Attachment #8492849 - Flags: approval-mozilla-aurora+
Attachment #8492851 - Flags: approval-mozilla-beta?
Attachment #8492851 - Flags: approval-mozilla-beta+
Attachment #8492851 - Flags: approval-mozilla-aurora?
Attachment #8492851 - Flags: approval-mozilla-aurora+
Attachment #8492852 - Flags: approval-mozilla-beta?
Attachment #8492852 - Flags: approval-mozilla-beta+
Attachment #8492852 - Flags: approval-mozilla-aurora?
Attachment #8492852 - Flags: approval-mozilla-aurora+
Duplicate of this bug: 1006631
Assuming verified fixed since there are 0 reports of this crash in Fennec 34/35/36 and 0 reports in Fennec 33.0 Beta following 33.0b7.
Status: RESOLVED → VERIFIED
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.