Search code examples
androidc++bufferandroid-sourcelogcat

Android P-9.0.0_r53 Logcat Main Buffer Exceed Defined Size


In our Android AOSP, Logcat main buffer exceed the defined size no matter what is the size of it. And logcat -c or other commands doesn't works. after that it gives read: unexpected EOF! I was looking in the source-codes of logcat.cpp couldn't find any particular thing. Do you know why this problem occurs ?

adb logcat -g outputs:

eg: when issue is happening (read: unexpected EOF!)
main: ring buffer is 4Mb (20Mb consumed), max entry is 5120b, max payload is 4068b
system: ring buffer is 4Mb (257Kb consumed), max entry is 5120b, max payload is 4068b
crash: ring buffer is 4Mb (13Kb consumed), max entry is 5120b, max payload is 4068b

Solution

  • I found the problem and solution.

    the main reason of the problem is setting of system date to older dates than the initial date. Time doesn't matter though.

    In my case:

    I don't know why but the system initial date is always +1 day than now. When the system date is synced with the current date ( which is older date for the system initial date), buffer start to overflow and clear buffer commands doesn't work.

    You can test with setting the date to the next day or next dates. You can check buffer sizes and consumed with ´adb logcat -g´ or ´adb logcat -b all -g´ and try to clear with ´adb logcat -c´.