Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

IllegalStateException: Fragment HomeFragment not attached to a context. #6832

Closed
pocmo opened this issue Nov 27, 2019 · 15 comments
Closed

IllegalStateException: Fragment HomeFragment not attached to a context. #6832

pocmo opened this issue Nov 27, 2019 · 15 comments
Assignees
Labels
b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info 🐞 bug Crashes, Something isn't working, .. eng:qa:not-needed Added by QA to issues that cannot be tested needs:investigation P1 Current sprint S1 Blocks development/testing, may impact more than 25% of users, causes data loss, potential chemspill
Milestone

Comments

@pocmo
Copy link
Contributor

pocmo commented Nov 27, 2019

https://sentry.prod.mozaws.net/operations/fenix-nightly/issues/6162466/
https://sentry.prod.mozaws.net/operations/fenix-nightly/issues/6162466/
Socorro link

IllegalStateException: Fragment HomeFragment{1a41004} (84c6a2c6-6203-448c-b564-fee8f55208fc)} not attached to a context.
    at androidx.fragment.app.Fragment.requireContext(Fragment.java:2)
    at androidx.fragment.app.Fragment.getResources(Fragment.java:1)
    at org.mozilla.fenix.home.HomeFragment$onViewCreated$2.invokeSuspend(HomeFragment.kt:9)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:2)
    at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:15)
...
(2 additional frame(s) were not displayed)

Fragment HomeFragment{1a41004} (84c6a2c6-6203-448c-b564-fee8f55208fc)} not attached to a context.

┆Issue is synchronized with this Jira Task

@pocmo pocmo added b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info 🐞 bug Crashes, Something isn't working, .. labels Nov 27, 2019
@boek boek added needs:investigation P1 Current sprint labels Dec 27, 2019
@boek boek added this to Prioritized Bug Backlog in Fenix Sprint Kanban Dec 27, 2019
@vesta0
Copy link
Collaborator

vesta0 commented Jan 6, 2020

Need STR for this.

@vesta0 vesta0 added the S1 Blocks development/testing, may impact more than 25% of users, causes data loss, potential chemspill label Jan 6, 2020
@vesta0 vesta0 added this to Polish Bugs to Triage in Feature Polish via automation Jan 6, 2020
@vesta0 vesta0 removed this from Prioritized Bug Backlog in Fenix Sprint Kanban Jan 6, 2020
@vesta0 vesta0 moved this from Polish Bugs to Triage to Prioritized Backlog in Feature Polish Jan 6, 2020
@severinrudie severinrudie moved this from Prioritized Backlog to In Dev Review in Feature Polish Jan 6, 2020
@severinrudie severinrudie added the eng:qa:needed QA Needed label Jan 8, 2020
@severinrudie
Copy link
Contributor

Note to QA: this is a very rare crash, and I don't think we're going to be able to reproduce it. I'm also very confident in the fix. If you don't mind, I think it's safe can call this qa-not-needed.

@AndiAJ AndiAJ added eng:qa:not-needed Added by QA to issues that cannot be tested and removed eng:qa:needed QA Needed labels Jan 10, 2020
@severinrudie severinrudie moved this from In Dev Review to Done in Feature Polish Jan 10, 2020
@severinrudie
Copy link
Contributor

Closed by #7509

@liuche
Copy link
Contributor

liuche commented Jan 21, 2020

I'm still seeing issues for this https://sentry.prod.mozaws.net/operations/fenix-nightly/issues/6162466/

@liuche liuche reopened this Jan 21, 2020
Feature Polish automation moved this from Done to In progress Jan 21, 2020
@boek
Copy link
Contributor

boek commented Jan 21, 2020

We will monitor this over the next sprint

@liuche liuche mentioned this issue Jan 22, 2020
32 tasks
@liuche liuche added this to the v3.2 milestone Jan 22, 2020
@boek boek moved this from In progress to Prioritized Backlog in Feature Polish Feb 4, 2020
@boek boek added this to Triage in Fenix Crashes Feb 4, 2020
@boek
Copy link
Contributor

boek commented Feb 11, 2020

this is definitely a race condition/memory leak. This PR reliably causes the crash

@vesta0 vesta0 removed this from Prioritized Backlog in Feature Polish Mar 29, 2020
@ekager
Copy link
Contributor

ekager commented Apr 21, 2020

Possible that leak fixes for home in #10033 and #10012 will resolve these issues. We should monitor Nightly and see if instances start to decrease.

@liuche
Copy link
Contributor

liuche commented Apr 22, 2020

Looks like some change since mid-march in socorro 🤔

@ekager
Copy link
Contributor

ekager commented Apr 23, 2020

Okay another fix landed - after the next Nightly goes out let's monitor crash stats 🤞🏻

Amejia481 pushed a commit to Amejia481/fenix that referenced this issue Apr 23, 2020
@liuche liuche mentioned this issue Apr 28, 2020
32 tasks
@AaronMT
Copy link
Contributor

AaronMT commented May 14, 2020

java.lang.IllegalStateException: Fragment HomeFragment{32dd527} (861da8e7-151f-4367-9f5a-af37c10c6e3b)} not attached to a context.
     FATAL EXCEPTION: main
Process: org.mozilla.fenix.debug, PID: 9206
java.lang.IllegalStateException: Fragment HomeFragment{32dd527} (861da8e7-151f-4367-9f5a-af37c10c6e3b)} not attached to a context.
	at androidx.fragment.app.Fragment.requireContext(Fragment.java:805)
	at org.mozilla.fenix.ext.FragmentKt.getRequireComponents(Fragment.kt:22)
	at org.mozilla.fenix.home.HomeFragment.getSessionManager(HomeFragment.kt:150)
	at org.mozilla.fenix.home.HomeFragment.getListOfSessions(HomeFragment.kt:836)
	at org.mozilla.fenix.home.HomeFragment.getListOfTabs(HomeFragment.kt:842)
	at org.mozilla.fenix.home.HomeFragment.emitSessionChanges(HomeFragment.kt:832)
	at org.mozilla.fenix.home.HomeFragment.access$emitSessionChanges(HomeFragment.kt:111)
	at org.mozilla.fenix.home.HomeFragment$onCreateView$sessionObserver$1.invoke(HomeFragment.kt:188)
	at org.mozilla.fenix.home.HomeFragment$onCreateView$sessionObserver$1.invoke(HomeFragment.kt:111)
	at org.mozilla.fenix.home.BrowserSessionsObserver$onStart$1$invokeSuspend$$inlined$collect$1.emit(Collect.kt:137)

https://console.firebase.google.com/u/0/project/moz-fenix/testlab/histories/bh.66b7091e15d53d45/matrices/8796887443883565548/executions/bs.e2cfcee6e6e97791

@AaronMT
Copy link
Contributor

AaronMT commented May 19, 2020

Another crash

https://console.firebase.google.com/u/0/project/moz-fenix/testlab/histories/bh.66b7091e15d53d45/matrices/8814662090942448693/executions/bs.b7e71229a2ddee82/issues

java.lang.IllegalStateException: Fragment HomeFragment{ed2a8} (c8f516b5-7891-4bf9-92db-114042a3c802)} not attached to a context.
     FATAL EXCEPTION: main
Process: org.mozilla.fenix.debug, PID: 8890
java.lang.IllegalStateException: Fragment HomeFragment{ed2a8} (c8f516b5-7891-4bf9-92db-114042a3c802)} not attached to a context.
	at androidx.fragment.app.Fragment.requireContext(Fragment.java:805)
	at org.mozilla.fenix.ext.FragmentKt.getRequireComponents(Fragment.kt:22)
	at org.mozilla.fenix.home.HomeFragment.getSessionManager(HomeFragment.kt:150)
	at org.mozilla.fenix.home.HomeFragment.getListOfSessions(HomeFragment.kt:836)
	at org.mozilla.fenix.home.HomeFragment.getListOfTabs(HomeFragment.kt:842)
	at org.mozilla.fenix.home.HomeFragment.emitSessionChanges(HomeFragment.kt:832)
	at org.mozilla.fenix.home.HomeFragment.access$emitSessionChanges(HomeFragment.kt:111)
	at org.mozilla.fenix.home.HomeFragment$onCreateView$sessionObserver$1.invoke(HomeFragment.kt:188)
	at org.mozilla.fenix.home.HomeFragment$onCreateView$sessionObserver$1.invoke(HomeFragment.kt:111)
	at org.mozilla.fenix.home.BrowserSessionsObserver$onStart$1$invokeSuspend$$inlined$collect$1.emit(Collect.kt:137)```

@sflorean
Copy link
Contributor

I was able to reproduce this crash on Nightly 5/21. Device: Motorola Nexus 6 (Android 7.1.1).
STR:

  1. Launch Fenix with a clean profile.
  2. Tap on "Read our privacy notice" link from the "Your privacy card" - onboarding.

Reproducible 3/3.
https://crash-stats.mozilla.org/report/index/be958eb3-64a8-4f7a-9608-1b0b90200521

ekager added a commit to ekager/fenix that referenced this issue May 21, 2020
@liuche liuche mentioned this issue Jun 10, 2020
29 tasks
@liuche liuche added this to Backlog in Theme: Eng Health via automation Jun 24, 2020
@liuche liuche moved this from Backlog to Crash backlog in Theme: Eng Health Jun 24, 2020
@ekager
Copy link
Contributor

ekager commented Jun 25, 2020

cc @sflorean are you still able to reproduce with those STR?

@kbrosnan kbrosnan removed this from Backlog in Fenix Crashes Jun 30, 2020
@kbrosnan kbrosnan added this to Needs triage in Android: Crash Tracking via automation Jun 30, 2020
@ekager ekager added the eng:qa:needed QA Needed label Jul 14, 2020
@sflorean
Copy link
Contributor

@ekager sorry for the late reply here! Tested with the same device on Nightly 7/16 and on 79.0.0-beta.7 and the issue isn't reproducible anymore.

@sflorean sflorean removed the eng:qa:needed QA Needed label Jul 17, 2020
@pocmo pocmo closed this as completed Jul 17, 2020
Android: Crash Tracking automation moved this from Needs triage to Closed Jul 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info 🐞 bug Crashes, Something isn't working, .. eng:qa:not-needed Added by QA to issues that cannot be tested needs:investigation P1 Current sprint S1 Blocks development/testing, may impact more than 25% of users, causes data loss, potential chemspill
Projects
No open projects
Development

No branches or pull requests

9 participants