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

Sample app continues crash because of LeakedClosableObjects + detectDiskReads #811

Closed
underwindfall opened this issue Apr 27, 2022 · 3 comments

Comments

@underwindfall
Copy link

underwindfall commented Apr 27, 2022

✍️ Describe the bug

Basically, when I install a sample app, the app'll crash because of LeakedClosableObjects + detectDiskReads in Strictmode
it's quite similar as #782
According to this issue, I think that i have ideas to fix this. I suppose there are two things to do

  1. We need to enable StrictMode before super.onCreate called according to the official site https://developer.android.com/reference/android/os/StrictMode
  2. the real reason it continues crashing is because of LeakCanary the related issue is here DiskReadViolation when calling LeakCanary.setConfig() in Application.onCreate() square/leakcanary#2117, so the fix needs to bump a version for this.

If you agree on this, I can make a PR to fix this issue.

💣 Steps to reproduce

  1. Go to app
  2. See error

🔧 Expected behavior

the app shouldn't crash

📷 Screenshots

file.mp4

Addition context

D/StrictMode: StrictMode policy violation: android.os.strictmode.LeakedClosableViolation: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. Callsite: close
        at android.os.StrictMode$AndroidCloseGuardReporter.report(StrictMode.java:1929)
        at dalvik.system.CloseGuard.warnIfOpen(CloseGuard.java:305)
        at sun.nio.fs.UnixSecureDirectoryStream.finalize(UnixSecureDirectoryStream.java:580)
        at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:291)
        at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:278)
        at java.lang.Daemons$Daemon.run(Daemons.java:139)
        at java.lang.Thread.run(Thread.java:923)

📱 Tech info

  • Device: Pixe 2
  • OS: Android 11
  • Chucker version: 4.0.0-SNAPSHOT
@cortinico
Copy link
Member

Basically, when I install a sample app, the app'll crash because of LeakedClosableObjects + detectDiskReads in Strictmode

Are you talking about the head of develop or another revision?
I've just tested it + I've also tried to enable StrictMode before super.onCreate but I wasn't able to reproduce.

Unless we have a consistent way to reproduce this, we can't really fix it.

@underwindfall
Copy link
Author

Basically, when I install a sample app, the app'll crash because of LeakedClosableObjects + detectDiskReads in Strictmode

Are you talking about the head of develop or another revision? I've just tested it + I've also tried to enable StrictMode before super.onCreate but I wasn't able to reproduce.

Unless we have a consistent way to reproduce this, we can't really fix it.

Hello, it's the develop branch I've tested. It's wierd that on my side I can reproduce it like 100%.

@underwindfall
Copy link
Author

I'm closing this issue since I think it probably depends on the device I tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants