RootTools
RootTools copied to clipboard
Issue on Nexus 10 JB4.3 - SEGV_MAPERR
What steps will reproduce the problem?
- Call "RootTools.RootTools.isRootAvailable()" in a separate thread in "onResume()" of Activity.
What is the expected output? What do you see instead?
The device root value is returned, but then there are a series of SEGV_MAPERR in the DDMS logs. This happens everytime.
What version of the product are you using? On what operating system?
RootTools 3.0 on Nexus 10, Android 4.3, Build No JWR66Y
Is this observed on any other version?
Very disturbing. Typically I would fault an OOM error but a Nexus 10 has 2 GB RAM. Unless you are running some other app at the same time that's using up all your memory? Would you mind adding the code below and call it before and after calling isRootAvailable()?
private void quickDirtyCheck() {
MemoryInfo mInfo = new ActivityManager.MemoryInfo();
((ActivityManager)context.getSystemService(ACTIVITY_SERVICE)).getMemoryInfo(Info);
RootTools.log("Available memory: " + mInfo.availMem +
(mInfo.lowMemory ? " and that's too low!" : ""));
}
Hi, Thanks for responding. Here are the logs, D/ROOTTOOLS( 3290): Available memory: 704278528 D/ROOTTOOLS( 3290): Available memory: 650276864
Below are some of my findings,
- The seg fault happens mainly if I run the root check inside a Thread/AsyncTask. Running it on the main thread does not cause issues.
- The line that causes issue is in Shell.java when we try to create a new root shell with "su" command, this.proc = new ProcessBuilder("su").redirectErrorStream(true).start(); once this line is executed the ddms logs show the crash dumps.
- When I do a "adh shell ps", I see a whole bunch of processes that are created because of ProcessBuilder which are never closed. It seems like it hits the zombie process issue as mentioned here, http://stackoverflow.com/a/15485210/987105
Let me know if I should copy/paste the code and/or logs?