Skip to content
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

BUG: legacyFindMountRootDirs process.waitFor results in startup deadlock/hang #316

Open
rockaport opened this issue Jan 15, 2024 · 2 comments

Comments

@rockaport
Copy link

With Android using more and more APEX files the mount command can return more data than the default read buffer can handle. Calling process.waitFor without reading the buffer first will result in waitFor waiting indefinitely.

Here's an SO post that describes the issue in more detail. I'm open to submitting a pull request, but it might be best to look through the source and find/fix any other instances of this just to be safe.

            Process proc = new ProcessBuilder().command("mount")
                    .redirectErrorStream(true).start();
            proc.waitFor(); // this needs to be moved to the end
            InputStream is = proc.getInputStream();

            BufferedReader r = new BufferedReader(
                    new InputStreamReader(is, UTF8_CHARSET));
@lysek
Copy link

lysek commented Jun 20, 2024

This is also an issue when using ATAK on a rooted phone, where mount command returns much more items than on a non-rooted phone.

@bisgroves
Copy link

Do you have a pull request ready to submit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants