Skip to content

runtime: android logging corruption on Android 5.1 #12008

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

Closed
crawshaw opened this issue Aug 4, 2015 · 5 comments
Closed

runtime: android logging corruption on Android 5.1 #12008

crawshaw opened this issue Aug 4, 2015 · 5 comments

Comments

@crawshaw
Copy link
Member

crawshaw commented Aug 4, 2015

I was debugging over someone's shoulder today and their panic as written to logcat was corrupt:

W/logd    (26732): Dropped 6
?/o       (26732): unexpected fault address 0x0
W/logd    (26732): Dropped 6
?/o       (26732): fatal error: fault
W/logd    (26732): Dropped 6
?/o       (26732): [signal 0x7 code=0x1 addr=0x0 pc=0xa5b5cd30]
W/logd    (26732): Dropped 6
W/logd    (26732): Dropped 6
?/o       (26732): goroutine 32 [running]:

There may be a change the logdw format, or we may have always had it slightly wrong but it worked with older Android versions.

I see some suggestions on the internet that the wire format is the layout of struct logger_entry_v3, which looks similar to but not the same as what we are writing:

https://android.googlesource.com/platform/system/core/+/master/include/log/logger.h

/cc @hyangah

@crawshaw crawshaw added this to the Go1.6 milestone Aug 4, 2015
@hyangah
Copy link
Contributor

hyangah commented Aug 4, 2015

I believe log_entry and (logger_entry_*) are for reading log data.
For writing this is the relevant part:
https://github.com/android/platform_system_core/blob/master/liblog/logd_write.c

Looking at the history, indeed there are some changes we have to pick up (those checked in after March).

@hyangah
Copy link
Contributor

hyangah commented Aug 4, 2015

BTW, for long term, we need to find a better solution. Currently we are relying on Android's private api (protocol between liblog and logger) which means it can break any time.

@crawshaw
Copy link
Member Author

crawshaw commented Aug 5, 2015

Further investigation suggests this is a very isolated behavior. The exact device I saw it on was a T-Mobile Moto X (2nd gen) running Android 5.1.

I could not replicate the problem on a Nexus 7 (2nd gen) running Android 5.1.1.

@rsc
Copy link
Contributor

rsc commented Nov 5, 2015

Seems like we can't do anything unless this can be reproduced.

@rsc rsc closed this as completed Nov 5, 2015
@xiam
Copy link

xiam commented Nov 20, 2015

Just in case you came here looking for the reason why Android Studio is full of "Dropped: 6" lines, try using "adb logcat" instead.

@golang golang locked and limited conversation to collaborators Nov 27, 2016
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

6 participants