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

leackcanary crashed when detect leak #2396

Closed
gucj opened this issue Jun 29, 2022 · 2 comments
Closed

leackcanary crashed when detect leak #2396

gucj opened this issue Jun 29, 2022 · 2 comments

Comments

@gucj
Copy link

gucj commented Jun 29, 2022

Description

leackcanary crashed when detect leak。

Steps to Reproduce

after add the leakcanary-android dependency to our app’s build.gradle file,build and install app 。

  1. start our application to test.
  2. when leaks sometimes leackcanary can detect success,but sometimes applicaiton crashed and the log show the crash is caused by leackcanary。

Crash Log:

Exception:()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:929)

Version Information

  • LeakCanary version:2.9.1
  • Android OS version:HarmonyOS 2.0.0
  • Gradle version:6.7
@gucj gucj added the type: bug label Jun 29, 2022
@rrsaikat
Copy link

rrsaikat commented Jul 7, 2022

Also faced this bug into android 12, please fix it @JakeWharton
nb: LeakCanary version:2.9.1

E/AndroidRuntime: FATAL EXCEPTION: pool-27-thread-1
    Process: com.example.myapp, PID: 12034
    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:920)

@pyricau
Copy link
Member

pyricau commented Jul 8, 2022

Duplicate of #2371. Will be fixed in the next release.

@pyricau pyricau closed this as completed Jul 8, 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

3 participants