RootTools icon indicating copy to clipboard operation
RootTools copied to clipboard

Issue on Nexus 10 JB4.3 - SEGV_MAPERR

Open sriram-kakarala opened this issue 10 years ago • 3 comments

What steps will reproduce the problem?

  1. 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

sriram-kakarala avatar Mar 27 '14 10:03 sriram-kakarala

Is this observed on any other version?

sriram-kakarala avatar Apr 01 '14 05:04 sriram-kakarala

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!" : ""));
}

Fusion avatar Apr 01 '14 07:04 Fusion

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,

  1. 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.
  2. 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.
  3. 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?

sriram-kakarala avatar Apr 01 '14 07:04 sriram-kakarala