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

analytics-android should provide resilience on corrupted QueueFile #794

Open
segfault87 opened this issue Mar 3, 2022 · 0 comments
Open
Assignees

Comments

@segfault87
Copy link

segfault87 commented Mar 3, 2022

We are getting following error from a certain point after upgrading android target SDK from 28 to 29 and rendering the library stop working for some users.

 2022-03-03 14:03:50.415 5511-5724/? E/Analytics: Error while uploading payloads
    java.io.IOException: At least one payload must be provided.
        at com.segment.analytics.SegmentIntegration$BatchPayloadWriter.endBatchArray(SourceFile:3)
        at com.segment.analytics.SegmentIntegration.performFlush(SourceFile:9)
        at com.segment.analytics.SegmentIntegration$3.run(SourceFile:2)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        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)
        at com.segment.analytics.internal.Utils$AnalyticsThread.run(SourceFile:2)

After some research, we found out a single payload is larger than 475 KB and this is the cause of the exception.

In our case, newSize was 1702131567. Something's definitely wrong with the number.

So we managed to dump and inspect the queue file and found out the file is completely corrupt.

스크린샷 2022-03-03 오후 6 37 54

1702131567 can be translated to 0x6574776f. First four bytes should be payload length but we can see a part of payload data is taking the space instead.

We still haven't figured out what's causing this. Aside of that we think the library should run nonetheless the queue file is corrupt (by clearing up corrupt files).

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

Successfully merging a pull request may close this issue.

2 participants