Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/mobile: when a panic happens, a long enough traceback deadlocks the runtime on Android #35590
What version of Go are you using (
Wonder if it's possible to let the gomobile directly send all logs to logd using the code similar to runtime/write_err_android.go. More desirably, would be nice if it allows users to turn it on and off - I found logging from some libraries is too chatty for mobile application use cases.
As stderr may be written while the world is frozen (e.g. the runtime dumping the traceback of a panic), the redirection of stdout and stderr to Android's logcat cannot be done in Go but in C. This implementation spawns a detached thread which will wait for stdout or stderr to be readable, and when so, read one line at a time and write it to Android's logcat. Fixes golang/go#35590