-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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]: Android 12 Phantom Processes Killed "[Process completed (signal 9) - press Enter]" #2366
Comments
Do you get anymessages in an |
I'm looking at the logcat.txt file right now but I do not know exactly what I should be looking for since this is my introduction to them. What should I show you? Everything around the time that I hit Enter? Or everything since I open up Termux up to when I get the " |
Something like all messages from when termux is killed and 15 s before and after should be interesting (you could also share the entire log if you are confident it does not contain sensitive information). What I am curious about is if there is any messages from "android"/"system"/"low memory killer" or something else that indicates that termux is killed, and in that case why. I don't think any maintainer has a device with android 12 yet, so might be specific for recent android versions |
I'll do the 15 seconds before and after since I'm not confident the entire log won't contain anything I wouldn't want public. I'll show more if needed. Though it'll have to be in 12 hours or so.
I'm leaning on it being Android 12 related. Reason I reinstalled Termux was because I got an error on it (cannot recall if it was this same one) right after I updated the phone. I was looking for a reason to change to the F-Droid version from the Google Store and did it immediately without thinking much about the message I got. |
@V-no-A You should use P.S. On Pixel 5 with Android 12 it doesn't get suddenly killed. |
@xeffyr I thought I used logcat within ADB. I ran |
Then ok. But log is still too short, try capturing about 30 lines. Btw, I'm running now overnight test for this issue, leaving Termux just opened with no utilities running except shell. Screen off, no wakelock, recent apps list cleared. |
Android 12 via
Check Basically, not a Termux issue and users upgrading to android 12 should expect killing of background processes even from AOSP, like OEM crazy killing wasn't enough. When you detect the killing, you can run |
I haven't looked much at the code, but it seems that Post output of following to see if there are other phantom processes running. What are your other apps doing?
Or if you want to run from inside termux, first grant one time permissions over
then run
The
I can reproduce the issue by running following. Sometimes termux gets killed as soon as I run the loop while its still in foreground, sometimes when I switch to another app and come back, and sometimes takes a few minutes. The frequency of sampling for the processes usage is likely the cause, considering that
You can monitor cpu usage with Basically, unless this is somehow fixed or exempted, this would be like the end of termux (and tasker) or at least will be very unreliable. This should be reported to google since this is just crazy, possibly crazier than OEM killing. Edit: It also happens with battery optimizations disabled for termux, don't see any related code either. Adaptive battery disabled too. dumpsys activity processes log
Well that is the question. Its advisable to review it first, but one may not always know what's sensitive. |
So based on
Edit: As per below comment, this will only help prevent trimming, processes using excessive CPU will still get killed. |
Everything went ok, Termux is not killed (expected). Device info:
|
Don't see any additional changes in For more proof its happening, posting detailed info below. Note that
Transcript to start 1 bash process + 40 sha256sum processes
Logcat showing 9 phantom processes trimmed
Remaining 32 tracked phantom processes
App and Device InfoTermux App InfoAPP_NAME: Device InfoSoftwareOS_VERSION: HardwareMANUFACTURER:
What's the output for |
Build info:
|
Have tried your command with
Device became laggy and Termux was eventually terminated as well as number of other apps. But no "phantom" processes killed:
|
More details about Termux being killed after |
Well, you are on Pixel specific changes could have been made privately. I guess we can ask google for more info.
Don't see any entry in above log for |
The The |
For this particular instance, I had Google Drive, Google Photos, and Gmail opened in the background; all three not doing anything. Termux was opened on the welcome text. I went to the phone's home screen, turned off screen, came back around two minutes later, opened Termux, and was met with same "Process completed" message.
adb shell /system/bin/dumpsys activity processes -a
logcat.txt sent through email to @agnostic-apollo |
From emailed
On your device Try running the To check which app a user id belongs to, you can run something like |
It's interesting that some |
Moved phantom process details and how to disable trimming to https://gist.github.com/agnostic-apollo/dc7e47991c512755ff26bd2d31e72ca8 due to lack of heading support in comments. |
Issue opened at https://issuetracker.google.com/u/1/issues/205156966 |
@V-no-A You can try my new xposed module. Please visit https://github.com/dttzyjw0012/PhantomProcessesSavior. |
A new patch was just submitted to AOSP titled "add settings to toggle the phantom process monitoring in dev options" just FYI |
@MishaalRahmanGH Thanks a lot for notifying. This is indeed great news! I have posted a comment at https://issuetracker.google.com/u/1/issues/205156966#comment27 about it and asked for expected timeline of merger. |
Don't either of you have access to a pc? Run over adb usb if you can't figure out wireless way. And the pairing prompt must not be dismissed while pairing, use split screen.
That command is not for android 12, read #2366 (comment) |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Correct NetCat usage syntax is:
Make sure the pairing dialog was not dismissed (closed or disappeared) at the time when you are pairing or running this How to pair and connect to Wireless ADB on same device without PC:screen-20220918-094304.2.mp4
This is not true in case of phantom processes. Their limit is system-wide and works against all apps in summary. You can't override it with an application config but can change it through the ADB or root shell. |
This comment was marked as duplicate.
This comment was marked as duplicate.
…HANTOM_PROCS value in about page MONITOR_PHANTOM_PROCS will only be shown in Android 12+ devices and will be marked "<unsupported>" if its not supported in current android build. It will show in Termux Settings->About->Device Info->Software and in reports. Flag is available on Pixel Android 12L beta 3 and Android 13. Check FeatureFlagUtils for more details. Getting supported feature flags and their values is done through reflection on android "android.util.FeatureFlagUtils" class and requires bypassing android hidden API restrictions. Related issue termux#2366 https://issuetracker.google.com/u/1/issues/205156966#comment27
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Docs have been added for how to disable phantom process killer on Android
|
Edit: Check this comment for solution.
Problem description
I get a message saying
[Process completed (signal 9) - press Enter]
at, seemingly, random intervals. Once I press Enter, Termux closes. This may happen while I am running a Python script or simply under the "Welcome to Termux!" text after leaving Termux idle for a while (leaving the app/turning off the screen) and not having run any commands.Steps to reproduce the behavior.
I upgraded my Pixel 3a phone to Android 12 and downloaded Termux from F-Droid as well as Termux:API. I did the
termux-setup-storage
command and gave the app unrestricted battery usage under the Android Apps settings. Lastly, I installed Python usingpkg install python
.What is the expected behavior?
Previously, on Android 11, I had installed Termux from the Google Play Store. Not once did I ever get that
[Process completed (signal 9) - press Enter]
message. I was able to leave Termux running in the background indefinitely.System information
0.117
12
PIxel 3a
The text was updated successfully, but these errors were encountered: