Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/mobile: https(ioutils) crashes the app #9416
I have a cache service runs on android(as a executable). It forwards the https requests and caches the results for apps on devices. After go1.4, I try to integrate this component as native function to cope more efficiently with Android environment. But thing goes weird when I tried to initiate a https request using native call, the call would crash the app. I traced the problem down and the root cause appears to locate at bottom level where certificates are loaded using go ioutils.
What version of Go are you using (go version)?
What operating system and processor architecture are you using?
What did you do?
in modified golang.org/x/mobile/example/libhello
with the following
What did you expect to see?
Correctly return html body
What did you see instead?
The call crashes the app
Thanks, but I still get app crashes after adding the permission.
I tracked down the crash to
I was able to isolate the problem by using ioutil to read directory. And the file number in the directory is related to crash. That is, more files in directory, the more likely the app crash. It might be the limited memory size in managed Android environment that causing the problem.
I used /system/etc/security/cacerts, the directory contains ca which is 5KB average. And the app would crash after put 70 ca in the directory.
And I got the error log after sync to your patch