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

StrictMode DiskReadViolation with 4.1.0 #259

Open
eric-labelle opened this issue Jan 15, 2024 · 7 comments
Open

StrictMode DiskReadViolation with 4.1.0 #259

eric-labelle opened this issue Jan 15, 2024 · 7 comments

Comments

@eric-labelle
Copy link

The problem

When upgrading to the lastest 4.1.0 version of the SDK, the flow crashes as soon as it tries to launch when StrictMode is enabled.

Environment

Android OS Version 14.0.0 (34)
Android Devices/Emulators Pixel 4 Emulator

Steps to Reproduce

Launch the Plaid bank linking flow with StrictMode enabled.

Expected Result

The first screen of the flow should be shown.

Actual Result

StrictMode policy violation; ~duration=54 ms: android.os.strictmode.DiskReadViolation
    at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1666)
    at libcore.io.BlockGuardOs.access(BlockGuardOs.java:74)
    at libcore.io.ForwardingOs.access(ForwardingOs.java:128)
    at android.app.ActivityThread$AndroidOs.access(ActivityThread.java:8054)
    at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:313)
    at java.io.File.exists(File.java:813)
    at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:790)
    at android.app.ContextImpl.ensurePrivateCacheDirExists(ContextImpl.java:786)
    at android.app.ContextImpl.getCacheDir(ContextImpl.java:897)
    at android.content.ContextWrapper.getCacheDir(ContextWrapper.java:326)
    at com.plaid.internal.p5.get(SourceFile:250)
    at dagger.internal.Providers$1.get(Providers.java:29)
    at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
    at com.plaid.internal.t2$x.a(SourceFile:122)
    at com.plaid.internal.hh.<init>(SourceFile:63)
    at com.plaid.internal.lh.create(SourceFile:2)
    at androidx.lifecycle.ViewModelProvider$Factory.create(ViewModelProvider.kt:83)
    at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:187)
    at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:153)
    at com.plaid.internal.gh.onCreate(SourceFile:4)
    at androidx.fragment.app.Fragment.performCreate(Fragment.java:3094)
    at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:504)
    at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:268)
    at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943)
    at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1839)
    at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1782)
    at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:565)
    at android.os.Handler.handleCallback(Handler.java:958)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8177)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
@melissaosullivan
Copy link
Contributor

Hi @eric-labelle ,

Thanks for reporting this. I can reproduce it in 4.1.0. Are you also seeing this issue in 4.0.0?

We will address this in a patch release.

Thanks,
Melissa

@eric-labelle
Copy link
Author

Hi @eric-labelle ,

Thanks for reporting this. I can reproduce it in 4.1.0. Are you also seeing this issue in 4.0.0?

We will address this in a patch release.

Thanks, Melissa

Thanks @melissaosullivan. 4.0.0 works well for me. Just happens when bumping to 4.1.0.

@melissaosullivan
Copy link
Contributor

Thanks @eric-labelle.

I'm seeing a disk read violation in 4.0.0 as well. Based on the reports it seems likely that 4.1.0 has introduced a new issue, so I'd like address that first, but I'm having trouble isolating it. How are you enabling strict mode -- on the device developer options or with StrictMode.setThreadPolicy()?

@eric-labelle
Copy link
Author

Oh wait, you're right, I overlooked that. Seeing DiskReadViolations on 4.0 also. Sorry about that. I'll try to dig deeper, might not be what causes the flow to exit afterall.

@melissaosullivan
Copy link
Contributor

Hi @eric-labelle, I think I've found the issue and addressed this in the 4.1.1 release. Please try out this version. Thanks for reporting this bug!

@eric-labelle
Copy link
Author

Hi @eric-labelle, I think I've found the issue and addressed this in the 4.1.1 release. Please try out this version. Thanks for reporting this bug!

Good timing, I was just trying to get more info on the crash. Bumping to 4.1.1 seems to be working well.
Is there any plan to eventually address all the DiskReadViolation though?

@melissaosullivan
Copy link
Contributor

@eric-labelle Good to hear this fixes that issue for you! Yes we do plan to address this DiskReadViolation but with a larger timeline. We can keep this open to track the DiskReadViolation progress.

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