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

UnbufferedIoViolation in Crashlytics #6391

Closed
stanhebben opened this issue Oct 19, 2024 · 5 comments
Closed

UnbufferedIoViolation in Crashlytics #6391

stanhebben opened this issue Oct 19, 2024 · 5 comments

Comments

@stanhebben
Copy link

[READ] Step 1: Are you in the right place?

Done

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 2024.1.1
  • Firebase Component: Crashlytics
  • Component version: 19.2.0
  • Device: OnePlus 8 (IN2013)
  • Android version: 13
  • Never seen in the emulator, only an a physical device

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

  • Have an app with crashlytics installed
  • Have a crash generated (in my case the crash was generated by a bug in my FirebaseMessagingService.onNewToken implementation)
  • Open the app
  • The app crashes with the following stack trace:
StrictMode policy violation: android.os.strictmode.UnbufferedIoViolation
    at android.os.StrictMode$AndroidBlockGuardPolicy.onUnbufferedIO(StrictMode.java:1647)
    at libcore.io.IoTracker.trackIo(IoTracker.java:35)
    at libcore.io.IoTracker.trackIo(IoTracker.java:45)
    at java.io.FileInputStream.read(FileInputStream.java:350)
    at android.os.ParcelFileDescriptor$AutoCloseInputStream.read(ParcelFileDescriptor.java:1023)
    at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:303)
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:210)
    at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:134)
    at java.io.FilterInputStream.read(FilterInputStream.java:107)
    at com.google.firebase.crashlytics.internal.common.SessionReportingCoordinator.convertInputStreamToString(SessionReportingCoordinator.java:425)
    at com.google.firebase.crashlytics.internal.common.SessionReportingCoordinator.convertApplicationExitInfo(SessionReportingCoordinator.java:396)
    at com.google.firebase.crashlytics.internal.common.SessionReportingCoordinator.persistRelevantAppExitInfoEvent(SessionReportingCoordinator.java:152)
    at com.google.firebase.crashlytics.internal.common.CrashlyticsController.writeApplicationExitInfoEventIfRelevant(CrashlyticsController.java:910)
    at com.google.firebase.crashlytics.internal.common.CrashlyticsController.doCloseSessions(CrashlyticsController.java:578)
    at com.google.firebase.crashlytics.internal.common.CrashlyticsController.finalizeSessions(CrashlyticsController.java:506)
    at com.google.firebase.crashlytics.internal.common.CrashlyticsCore.doBackgroundInitialization(CrashlyticsCore.java:250)
    at com.google.firebase.crashlytics.internal.common.CrashlyticsCore.lambda$doBackgroundInitializationAsync$0$com-google-firebase-crashlytics-internal-common-CrashlyticsCore(CrashlyticsCore.java:227)
    at com.google.firebase.crashlytics.internal.common.CrashlyticsCore$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
    at com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker.lambda$submit$1(CrashlyticsWorker.java:96)
    at com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker$$ExternalSyntheticLambda0.then(D8$$SyntheticClass:0)
    at com.google.android.gms.tasks.zze.run(com.google.android.gms:play-services-tasks@@18.1.0:1)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0$com-google-firebase-concurrent-CustomThreadFactory(CustomThreadFactory.java:47)
    at com.google.firebase.concurrent.CustomThreadFactory$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
    at java.lang.Thread.run(Thread.java:1012)

Relevant Code:

N/A

@lehcar09
Copy link
Contributor

Hi @stanhebben, thank you for reaching out and reporting the issue. I tried reproducing the issue, however, I did not encounter the issue.

May I ask a few questions for us to narrow down the issue.

  • Does this issue only occur on specific devices and/or different versions?
  • Does this occur on the previous version you’re using? Could you share the Firebase version prior to the version you’re currently using?

By any chance, could you share us an MCVE? That'll greatly help us in our investigation. Thanks!

@stanhebben
Copy link
Author

stanhebben commented Oct 21, 2024

The issue seems to only occur on one specific device (a OnePlus 8). I don't see it happening on the emulator or the Pixel 3a I have here.

It's on a new app, so no known older versions of Crashlytics where it doesn't occur. I will try to make a MCVE for it.

@lehcar09
Copy link
Contributor

Hey @stanhebben, I'll mark this as needs-info for now. Don't worry if the issue closes due to stale, we can always reopen this once we have new information. Thanks!

@stanhebben
Copy link
Author

stanhebben commented Oct 28, 2024

I didn't reliably reproduce the bug, but I did manage to reliably fix the problem.

Investigation into the bug led to the discovery that something along these lines ended up happening in my own code:

runBlocking {
  myScope.launch(Dispatchers.IO) {
    ..doing some network requests...
  }
}

And coroutines don't seem to like that, causing other unrelated coroutines - such as Crashlytics and GCM - to become stuck. This seems to be quite random as to what it breaks. On my emulator it seems to be mostly fine, on a real device... stuff breaks more often.

So I believe this issue can be closed. Thanks for trying to help, but the issue was caused elsewhere.

@exaby73
Copy link

exaby73 commented Oct 29, 2024

Hey @stanhebben. Based on your comment, I feel safe to close this issue. If you feel there is still an issue related to Crashlytics, feel free to comment and we can reopen or open a new issue and we can take a look at it. Thanks for providing valuable information

@exaby73 exaby73 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 29, 2024
@firebase firebase locked and limited conversation to collaborators Nov 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants