Keep the log catcher alive. #575
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the Android's log daemon (
logd) finds there are too many log records and some log reader (logcat) does not read them out in time, the reader may be kicked out. Therefore, the logcat can exit unexpectedly with a return code 1 and complainsread: Unexpected EOFin standard error stream (stderr).Refer to the AOSP's code for details: logcat/logcat.cpp#1161, logd/SimpleLogBuffer.cpp#345.
The module log (
error.log) and verbose log (all.log) of EdXposed are generated by two background logcat processes. So when a logcat process dies, EdXposed's log is also incomplete.A way to solve the problem is to increase logd's buffer size (by
logcat -G XXXor in Developer Options). But I think the buffer size is the user's choice. EdXposed's log system should work regardless of the user-specified log buffer size. (It is allowed to miss some logs if the buffer size is too small.)So I think it is a good choice to restart the logcat process once it is kicked out. However, if the logcat process is killed manually or by EdXposed Manager, it should not be restarted.
Since the method to kill the log catcher is changed, some changes are needed to be applied in EdXposed Manager. Check it in this pull request.