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

Under what circumstances would frida-server cause 100% CPU usage and become unresponsive? #478

Open
lanyuer opened this issue Aug 2, 2023 · 2 comments

Comments

@lanyuer
Copy link

lanyuer commented Aug 2, 2023

I started a frida-server, connected to it remotely, attached a process, and executed a script to call functions within the process. After running for some time, the frida-server becomes unresponsive. On my Pixel 4 phone, I noticed that the CPU is being exhausted, mainly by one process: unix:abstract=/frida-f4feb1bd-3f32-4282-bd which occupies 99.6% of the CPU.

I use strace to trace this process and sees that it keeps calling this piece of code:
ppoll([{fd=3, events=POLLIN}, {fd=13, events=POLLIN}], 2, {tv_sec=0, tv_nsec=142951995325120880}, NULL, 0) = 0 (Timeout) clock_gettime(CLOCK_MONOTONIC, {tv_sec=2278038456091393255, tv_nsec=4088476032}) = 0 ptrace(PTRACE_DETACH, 1452, NULL, SIG_0) = -1 ESRCH (No such process) ptrace(PTRACE_INTERRUPT, 1452) = -1 ESRCH (No such process) ppoll([{fd=3, events=POLLIN}, {fd=13, events=POLLIN}], 2, {tv_sec=0, tv_nsec=142951995325120880}, NULL, 0) = 0 (Timeout) clock_gettime(CLOCK_MONOTONIC, {tv_sec=2278596286443797735, tv_nsec=4088476032}) = 0 ptrace(PTRACE_DETACH, 1452, NULL, SIG_0) = -1 ESRCH (No such process) ptrace(PTRACE_INTERRUPT, 1452) = -1 ESRCH (No such process) ppoll([{fd=3, events=POLLIN}, {fd=13, events=POLLIN}], 2, {tv_sec=0, tv_nsec=142951995325120880}, NULL, 0) = 0 (Timeout) clock_gettime(CLOCK_MONOTONIC, {tv_sec=2279108590142864615, tv_nsec=4088476032}) = 0 ptrace(PTRACE_DETACH, 1452, NULL, SIG_0) = -1 ESRCH (No such^C{tv_sec=2295757257771695335, tv_nsec=4088476032}) = 0 ptrace(PTRACE_DETACH, 1452, NULL, SIG_0strace: Process 28541 detached

The problem is that this process of 1452 no longer exists. Is there something wrong with the way I am using it?

@asafe199
Copy link

asafe199 commented Oct 26, 2023

I've been handling the same issue here, I have a routine which runs my script for all day long.
However, I noticed that even closing frida "adb shell kill -9 {PID}" for each routine there are process in background

image

@ricsirigu
Copy link

ricsirigu commented Feb 27, 2024

CleanShot 2024-02-27 at 16 42 55

same issue here, with Frida 16.1.11 and 16.2.1. After a while the phone crashes.

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

No branches or pull requests

3 participants