Closed Bug 1251923 Opened 4 years ago Closed 4 years ago

crash in android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@d5ed1e9 -- permission denied for this window type at android.view.ViewRootImpl.setView(ViewRootImpl.java)

Categories

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

defect
Not set
critical

Tracking

()

RESOLVED FIXED
Firefox 48
Tracking Status
firefox45 --- wontfix
firefox46 + fixed
firefox47 + fixed
firefox48 --- fixed
fennec 46+ ---

People

(Reporter: ehsan, Assigned: sebastian)

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is 
report bp-c9eb43f6-9fed-4e8c-9c82-4ea722160228.
=============================================================

I'm getting this crash when clicking on an external link to open in Nightly. 100% reproducible.
I think this may have started since I have updated my phone to Android Marshmallow.
Sadly, this makes Fennec completely unusable for me.  I'll have to reluctantly switch browsers because of this.  :(
tracking-fennec: --- → ?
Sebastian it looks like you need to catch stuff other than the SecurityException when trying to show the snackbar thing.
Assignee: nobody → s.kaspari
tracking-fennec: ? → 46+
Oh, yeah, interesting. Looking through the crash reports it seems like this affects HTC devices on Marshmallow.
Status: NEW → ASSIGNED
(In reply to Sebastian Kaspari (:sebastian) from comment #4)
> Oh, yeah, interesting. Looking through the crash reports it seems like this
> affects HTC devices on Marshmallow.

That's me.  :-)
On this device can you go to:
Settings -> Apps -> (Gear Icon) -> Draw over other apps
(Those steps are for a Nexus device and can be slightly different on an HTC device)

And then see whether your installation is allowed to draw over other apps? I assume it is not. After you allow that, is the crash gone? I'll prepare a patch for this but I'd like to know if this is the same permission problem that we get when a SecurityException is thrown on a Nexus device.
Flags: needinfo?(ehsan)
Comment on attachment 8726735 [details]
MozReview Request: Bug 1251923 - TabQueueService: Treat BadTokenException like SecurityException. r?margaret

https://reviewboard.mozilla.org/r/38211/#review34683
Attachment #8726735 - Flags: review?(margaret.leibovic) → review+
(In reply to Sebastian Kaspari (:sebastian) from comment #6)
> On this device can you go to:
> Settings -> Apps -> (Gear Icon) -> Draw over other apps
> (Those steps are for a Nexus device and can be slightly different on an HTC
> device)
> 
> And then see whether your installation is allowed to draw over other apps? I
> assume it is not.

The permission says "No".

> After you allow that, is the crash gone? I'll prepare a
> patch for this but I'd like to know if this is the same permission problem
> that we get when a SecurityException is thrown on a Nexus device.

Yeah, doing that seems to make the crash go away!
Flags: needinfo?(ehsan)
Thanks! Then this patch is exactly what we need. :)
https://hg.mozilla.org/integration/fx-team/rev/815d8ea19eff49bf8c1172f5cc23126299f29ac9
Bug 1251923 - TabQueueService: Treat BadTokenException like SecurityException. r=margaret
Comment on attachment 8726735 [details]
MozReview Request: Bug 1251923 - TabQueueService: Treat BadTokenException like SecurityException. r?margaret

Requesting uplift because this affects all versions (but only some devices).

Approval Request Comment

[Feature/regressing bug #]: Tab Queues

[User impact if declined]: On (some?) HTC devices the app crashes if the tab queue feature is used. This does not create consistent stack traces so I can't really see how many users/devices are affected.

[Describe test coverage new/current, TreeHerder]: I don't have a device but with the stack trace and the feedback from Ehsan the problem and solution is obvious.

[Risks and why]: Very low risk, catching one additional exception.

[String/UUID change made/needed]: -
Attachment #8726735 - Flags: approval-mozilla-beta?
Attachment #8726735 - Flags: approval-mozilla-aurora?
Comment on attachment 8726735 [details]
MozReview Request: Bug 1251923 - TabQueueService: Treat BadTokenException like SecurityException. r?margaret

This hasn't landed on m-c yet but I'd like to take it for 46 beta 1 build which will start later today.
Attachment #8726735 - Flags: approval-mozilla-beta?
Attachment #8726735 - Flags: approval-mozilla-beta+
Attachment #8726735 - Flags: approval-mozilla-aurora?
Attachment #8726735 - Flags: approval-mozilla-aurora-
Only one crash recorded here but "makes firefox unusable" sounds bad. Tracking for 46+
(In reply to Liz Henry (:lizzard) (needinfo? me) from comment #14)
> Only one crash recorded here but "makes firefox unusable" sounds bad.
> Tracking for 46+

Yeah, it looks like our crash reporter treats them as different crashes because the signature contains the hash code of the object ("@d5ed1e9"). Those are all related:
https://crash-stats.mozilla.com/search/?signature=~permission+denied+for+this+window&_facets=signature&_columns=date&_columns=signature&_columns=product&_columns=version&_columns=build_id&_columns=platform#facet-signature
https://hg.mozilla.org/mozilla-central/rev/815d8ea19eff
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Comment on attachment 8726735 [details]
MozReview Request: Bug 1251923 - TabQueueService: Treat BadTokenException like SecurityException. r?margaret

This is in Beta and Nightly but did miss Aurora.
Attachment #8726735 - Flags: approval-mozilla-aurora- → approval-mozilla-aurora?
Comment on attachment 8726735 [details]
MozReview Request: Bug 1251923 - TabQueueService: Treat BadTokenException like SecurityException. r?margaret

One-line crash fix, taking it.
Attachment #8726735 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.