Closed Bug 1562622 Opened 7 years ago Closed 7 years ago

Startup crash - java.lang.IllegalStateException: This ViewTreeObserver is not alive, call getViewTreeObserver() again

Categories

(Firefox for Android Graveyard :: General, defect)

Unspecified
Android
defect
Not set
normal

Tracking

(firefox-esr60 wontfix, firefox-esr6869+ verified, firefox67 wontfix, firefox67.0.1 wontfix, firefox68 wontfix, firefox69 verified)

VERIFIED FIXED
Firefox 69
Tracking Status
firefox-esr60 --- wontfix
firefox-esr68 69+ verified
firefox67 --- wontfix
firefox67.0.1 --- wontfix
firefox68 --- wontfix
firefox69 --- verified

People

(Reporter: andrei.a.lazar, Assigned: andrei.a.lazar)

References

Details

(Whiteboard: [fennec68.1])

Crash Data

Attachments

(2 files)

Steps to reproduce:

  1. fresh install Fennec / clear all data
  2. close all internet connections

Expected result:
Onboarding screen is being shown

Actual result:
Application crashes with IllegalStateException

Crash sig:
java.lang.IllegalStateException: This ViewTreeObserver is not alive, call getViewTreeObserver() again
at android.view.ViewTreeObserver.checkIsAlive(ViewTreeObserver.java:850)
at android.view.ViewTreeObserver.removeOnGlobalLayoutListener(ViewTreeObserver.java:579)
at org.mozilla.gecko.home.TabMenuStripLayout$1.onGlobalLayout(TabMenuStripLayout.java:136)

Assignee: nobody → andrei.a.lazar

Now checking the global view tree observer to see if it's alive in order to unsubscribe from further
notifications.

Keywords: checkin-needed

Pushed by nbeleuzu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ea121152fa96
Startup crash - java.lang.IllegalStateException: This ViewTreeObserver is not alive, call getViewTreeObserver() again r=petru

Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69

esr68=affected because we should consider uplifting this crash fix to Fennec ESR 68.0.x or 68.1.

Andrei, we'll want to uplift your crash fix to Fennec ESR 68.1.

Flags: needinfo?(andrei.a.lazar)

Hello, I can confirm that the crash doesn't occur on Beta 69.0b6 using:

  • Motorola Moto G6 (Android 8);
  • Samsung Galaxy S8 (Android 9);
  • Google Pixel (Android Q);

Comment on attachment 9075132 [details]
Bug 1562622 Startup crash - java.lang.IllegalStateException: This ViewTreeObserver is not alive, call getViewTreeObserver() again r=petru

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: This is critical because it reproduces 100% of time.
  • User impact if declined: Users will encounter a significant amount of crashes.
  • Fix Landed on Version:
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This is a small change and doesn't change any behavior but rather adds a sanity check.
  • String or UUID changes made by this patch:
Flags: needinfo?(andrei.a.lazar)
Attachment #9075132 - Flags: approval-mozilla-esr68?

Comment on attachment 9075132 [details]
Bug 1562622 Startup crash - java.lang.IllegalStateException: This ViewTreeObserver is not alive, call getViewTreeObserver() again r=petru

Fixes a Fennec topcrash. Approved for 68.1b3.

Attachment #9075132 - Flags: approval-mozilla-esr68? → approval-mozilla-esr68+

Hi!
Verified as fixed on ESR 68.1b3 with OnePlus 5T (Android 9) and Motorola Nexus 6 (Android 7.1.1).
I will mark this as verified on Firefox esr68. Thanks!

Status: RESOLVED → VERIFIED
Crash Signature: [@ java.lang.IllegalStateException: at android.view.ViewTreeObserver.checkIsAlive(ViewTreeObserver.java)]

I just upgraded to 68.1b3 and still seeing this crash:
https://crash-stats.mozilla.org/report/index/1a6546bf-01e7-48b1-a25f-dbf050190724

Flags: needinfo?(andrei.a.lazar)

Can you give me some STR please? I can't manage to repro this with the initial STR

Flags: needinfo?(andrei.a.lazar) → needinfo?(robsmith11)

If I rotate the orientation of my phone while Firefox is open, it will crash about 50% of the time. It doesn't matter what is open in Firefox.

Locking the phone's orientation prevents the crash.

Flags: needinfo?(robsmith11)

Hi!
I tested the behavior described in Comment 15 on ESR 68.1b3, Beta 69.0b8 with OnePlus 5T (Android 9), Sony Xperia Z5 Premium (Android 7.1.1), Google Pixel (Android Q) and I could not reproduce it.
robsmith11: Please provide the device name and Android version.
Thank you!

Flags: needinfo?(robsmith11)

Hi Eliza, that should be in the crash report of comment 13.

Flags: needinfo?(robsmith11) → needinfo?(eliza.balazs)

Looks as if the device is HUAWEI EVR-L29 (Huawei Mate 20 X), and the API is 28.

Flags: needinfo?(eliza.balazs)

Hi! I tested this on ESR 68.1b3, Beta 69.0b9 with Huawei Mate 20 Lite (Android 8.1) and I wasn't able to reproduce the behavior from Comment 15. Thanks!

How do I run Firefox for Android in Safe Mode so that I can confirm the bug is not triggered by one of my settings?

BTW, searching using the crash report shows hundreds of other installs with thousands of other crashes across many devices and manufacturers, so I don't think it's device specific. Should a new bug ticket be opened for this?

robsmith11: Hello!
(In reply to robsmith11 from comment #20)

How do I run Firefox for Android in Safe Mode so that I can confirm the bug is not triggered by one of my settings?

You can try by Clearing Data from Android settings or reinstalling Fennec. Another option is to restart you device in safe mode.

(In reply to robsmith11 from comment #21)

BTW, searching using the crash report shows hundreds of other installs with thousands of other crashes across many devices and manufacturers, so I don't think it's device specific. Should a new bug ticket be opened for this?

Yes, a new ticket is needed, where we can add any new information and keep track of the issue. Thank you!

How do I back up and restore my profile (without root)?

I've installed Nightly and it's not crashing, so it's likely a setting but I don't want to lose my entire profile.

Even though I am not assigned I was requested to review this bug as a potential issue to another bug 1565488. I noticed the use of a local method variable being referenced from a callback method onGlobalLayout which could cause the NPE condition prior to the isAlive() check on the observer object. It is convention to everything I have seen to retrieve the TreeObserver object again inside the callback to ensure you have the latest reference provided.

I have attached a differential that will do exactly this and thereby eliminate the exception that is occuring.

Keywords: checkin-needed

Hi Brad, can you please request Beta/ESR68 approval on this patch too when you get a chance? Thanks!

Flags: needinfo?(brad.arant)

Comment on attachment 9081733 [details]
Bug 1562622 - Calling getViewTreeObserver again to get new object to test isAlive().;r?VladBaicu

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Requested by RyanVM to eliminate NPE condition.
  • User impact if declined: Continued NPEs reported daily.
  • Fix Landed on Version:
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Re-getting the GlobalLayout is considered normal practice for this object's usage.
  • String or UUID changes made by this patch: *NONE
Flags: needinfo?(brad.arant)
Attachment #9081733 - Flags: approval-mozilla-esr68?

Pushed by rvandermeulen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2fab9efb6ec5
Calling getViewTreeObserver again to get new object to test isAlive().;r=VladBaicu

Keywords: checkin-needed

Comment on attachment 9081733 [details]
Bug 1562622 - Calling getViewTreeObserver again to get new object to test isAlive().;r?VladBaicu

Potential Fennec topcrash fix. Approved for Fennec 68.1b5 and landing now for the 2-Aug nightly builds.

Attachment #9081733 - Flags: approval-mozilla-esr68? → approval-mozilla-esr68+
Attachment #9081733 - Flags: approval-mozilla-beta+
Whiteboard: [fennec68.1]
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

Creator:
Created:
Updated:
Size: