-
Notifications
You must be signed in to change notification settings - Fork 18k
x/mobile: https(ioutils) crashes the app #9416
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
Comments
To resolve the hostname (www.example.com) you need the permission ACCESS_NETWORK_STATE. Try add this permission to the manifest |
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. |
How many files are you seeing in the directory? Can you show us the error you are seeing on crash? (You may not see an error message if you are using 1.4 release. If so, could you sync after bee8ae1.) |
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
|
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)?
go1.4
What operating system and processor architecture are you using?
android 4.4.2
What did you do?
in modified golang.org/x/mobile/example/libhello
calling go function
with the following
What did you expect to see?
Correctly return html body
What did you see instead?
The call crashes the app
The text was updated successfully, but these errors were encountered: