Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalStateException: Already Closed after restarting the LeakCanary app from launcher #2421

Closed
dwichan0905 opened this issue Sep 26, 2022 · 4 comments

Comments

@dwichan0905
Copy link

dwichan0905 commented Sep 26, 2022

Description

This issue is rarely happened, but in my case the LeakCanary is strangely crashed. I think this is happened at Database Closing after user closed the LeakCanary

Steps to Reproduce

LeakCanary.Crash.mp4
  1. Open LeakCanary from Launcher
  2. Close LeakCanary by pressing the back button
  3. Open LeakCanary again, then the crash was happen

Expected behavior: LeakCanary opened and showing the memory leaks list as usual

Version Information

  • LeakCanary version: 2.9.1
  • Android OS version: 10 Q
  • Gradle version: 7.3.0

Additional Information

Logcat

Date: 9/26/22 12:23:43
Exception: java.lang.IllegalStateException
Tag: error
Message: Already closed

java.lang.IllegalStateException: Already closed
	at leakcanary.internal.activity.db.ScopedLeaksDb$DbOpener.checkClosed(ScopedLeaksDb.kt:69)
	at leakcanary.internal.activity.db.ScopedLeaksDb$DbOpener.getWritableDatabase(ScopedLeaksDb.kt:51)
	at leakcanary.internal.activity.db.Db$execute$1.invoke(Db.kt:35)
	at leakcanary.internal.activity.db.Db$execute$1.invoke(Db.kt:9)
	at leakcanary.internal.activity.db.Io$execute$2.invoke(Io.kt:44)
	at leakcanary.internal.activity.db.Io$execute$2.run(Io.kt:10)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:919)
@ghost
Copy link

ghost commented Sep 27, 2022

Firebase crashlytics also just picked up on this issue today for me as well.

leakcanary.internal.activity.db.ScopedLeaksDb$DbOpener.checkClosed (ScopedLeaksDb.kt:69)
leakcanary.internal.activity.db.ScopedLeaksDb$DbOpener.getWritableDatabase (ScopedLeaksDb.kt:51)
leakcanary.internal.activity.db.Db$execute$1.invoke (Db.kt:35)
leakcanary.internal.activity.db.Db$execute$1.invoke (Db.kt:9)
leakcanary.internal.activity.db.Io$execute$2.invoke (Io.kt:44)
leakcanary.internal.activity.db.Io$execute$2.run (Io.kt:10)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
java.lang.Thread.run (Thread.java:919)

Not sure what caused it (wasnt plugged into android studio at the time), but considering that the error log is exactly the same as OP, I'd say its probably the same cause.

@msfjarvis
Copy link
Contributor

Dupe of #2371

@kuangyliang
Copy link

kuangyliang commented Nov 2, 2022

same error. please help me solve it,please ~~~~

@pyricau
Copy link
Member

pyricau commented Nov 7, 2022

yep, duplicate, will be fixed in the next release.

@pyricau pyricau closed this as completed Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants