termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
36.86k stars 3.87k forks source link

[NOTICE]: Termux Processes Killed On Android 15 For OnePlus Devices #4219

Open Mubanjun opened 1 month ago

Mubanjun commented 1 month ago

Problem description

When opening Termux,it will throw "signal 9"directly. Screenshot_2024-10-20-10-57-35-62_84d3000e3f4017145260f7618db1d683

Steps to reproduce the behavior.

Open Termux

What is the expected behavior?

No response

System information

agnostic-apollo commented 1 month ago

Works fine on latest android 15 avd.

Screenshot_1729404939

Termux application version: latest

latest is not a version. Generate a report and post.

Issue is likely phantom process killer.

leafmoes commented 4 weeks ago

I have this problem too termux-report_issue_from_transcript.log

agnostic-apollo commented 4 weeks ago

TERMUX_APP_PACKAGE_VARIANT: APT_ANDROID_5

Read the installation docs again.

leafmoes commented 4 weeks ago

TERMUX_APP_PACKAGE_VARIANTAPT_ANDROID_5

再次阅读安装文档。

But it still says Killed.

termux-report_issue_from_transcript.log

agnostic-apollo commented 4 weeks ago

Disable phantom process killer as mentioned above.

agnostic-apollo commented 4 weeks ago

Seems like you already have.

Generate a full system log right after process gets killed.

https://github.com/termux/termux-packages/blob/site/site/pages/en/projects/docs/repos/main/packages/termux-tools/logcat/index.md#to-get-full-system-logs-of-other-apps-and-the-android-system

leafmoes commented 4 weeks ago

I executed this command, but it had no effect:

adb shell "settings put global settings_enable_monitor_phantom_procs false"
leafmoes commented 4 weeks ago

The result of this command returns false

adb shell "settings get global settings_enable_monitor_phantom_procs"
agnostic-apollo commented 4 weeks ago
libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 6273 (init), pid 6273 (init)
libc    : crash_dump helper failed to exec, or was killed
linker  : error: unable to open file "/data/data/com.termux/files/usr/bin/bash
"

There is unexpected newline at end of bash path, might be related.

But your logs didn't contain execution history. Exit termux, then run adb shell "logcat -c", then restart termux again and wait for killing and then generate log again.

leafmoes commented 4 weeks ago

logcat.txt

agnostic-apollo commented 3 weeks ago
W login   : type=1400 audit(0.0:6583): avc:  granted  { execute } for  path="/data/data/com.termux/files/usr/bin/dash" dev="dm-74" ino=602426 scontext=u:r:untrusted_app_27:s0:c57,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c57,c258,c512,c768 tclass=file app=com.termux
E OPLUS_KEVENT_RECORD: oplus_kevent Receive message from kernel, event_type=3
E OPLUS_KEVENT_RECORD: OPLUS_KEVENT payload:10569,path@@/data/data/com.termux/files/usr/bin/dash
I OPLUS_KEVENT_RECORD: oplus_put_exec_kevent_to_list
W login   : type=1400 audit(0.0:6584): avc:  granted  { execute } for  name="bash" dev="dm-74" ino=602768 scontext=u:r:untrusted_app_27:s0:c57,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c57,c258,c512,c768 tclass=file app=com.termux
E OPLUS_KEVENT_RECORD: oplus_kevent Receive message from kernel, event_type=3
E OPLUS_KEVENT_RECORD: OPLUS_KEVENT payload:10569,path@@/data/data/com.termux/files/usr/bin/dash
I OPLUS_KEVENT_RECORD: oplus_put_exec_kevent_to_list
E OPLUS_KEVENT_RECORD: oplus_kevent Receive message from kernel, event_type=3
E OPLUS_KEVENT_RECORD: OPLUS_KEVENT payload:10569,path@@/data/data/com.termux/files/usr/bin/dash
I OPLUS_KEVENT_RECORD: oplus_put_exec_kevent_to_list

The logs didn't reveal anything new. The linker error doesn't exist now. It could be OnePlus specific killer via OPLUS_KEVENT_RECORD that's killing the process, its known to kill processes running with proot, but there should be some additional entries for the killing, maybe they are not being logged due to rate limit. If its a OnePlus issue like it is for proot, there is nothing we can do, report to OnePlus.

Run adb shell "logcat -c" again and then get bash killed 5-6 times and then generate a dump again. Also try going into failsafe session and running /system/bin/ls and $PREFIX/bin/ls and see if they work.

Mubanjun commented 3 weeks ago

Android15的应用权限缩得很紧,即使从Outlook打开网页都会崩溃

获取Outlook for Androidhttps://aka.ms/AAb9ysg


From: agnostic-apollo @.> Sent: Wednesday, October 30, 2024 3:46:15 PM To: termux/termux-app @.> Cc: 木板菌 @.>; Author @.> Subject: Re: [termux/termux-app] [Bug]: Android 15 will directly print "killed" and return signal 9 (Issue #4219)

W login : type=1400 audit(0.0:6583): avc: granted { execute } for path="/data/data/com.termux/files/usr/bin/dash" dev="dm-74" ino=602426 scontext=u:r:untrusted_app_27:s0:c57,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c57,c258,c512,c768 tclass=file app=com.termux E OPLUS_KEVENT_RECORD: oplus_kevent Receive message from kernel, event_type=3 E OPLUS_KEVENT_RECORD: OPLUS_KEVENT payload:10569,path@@/data/data/com.termux/files/usr/bin/dash I OPLUS_KEVENT_RECORD: oplus_put_exec_kevent_to_list W login : type=1400 audit(0.0:6584): avc: granted { execute } for name="bash" dev="dm-74" ino=602768 scontext=u:r:untrusted_app_27:s0:c57,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c57,c258,c512,c768 tclass=file app=com.termux E OPLUS_KEVENT_RECORD: oplus_kevent Receive message from kernel, event_type=3 E OPLUS_KEVENT_RECORD: OPLUS_KEVENT payload:10569,path@@/data/data/com.termux/files/usr/bin/dash I OPLUS_KEVENT_RECORD: oplus_put_exec_kevent_to_list E OPLUS_KEVENT_RECORD: oplus_kevent Receive message from kernel, event_type=3 E OPLUS_KEVENT_RECORD: OPLUS_KEVENT payload:10569,path@@/data/data/com.termux/files/usr/bin/dash I OPLUS_KEVENT_RECORD: oplus_put_exec_kevent_to_list

The logs didn't reveal anything new. The linker error doesn't exist now. It could be OnePlus specific killer via OPLUS_KEVENT_RECORD that's killing the process, its known to kill processes running with proot, but there should be some additional entries for the killing, maybe they are not being logged due to rate limit. If its a OnePlus issue like it is for proot, there is nothing we can do, report to OnePlus.

Run adb shell "logcat -c" again and then get bash killed 5-6 times and then generate a dump again. Also try going into failsafe sessionhttps://wiki.termux.com/wiki/Recover_a_broken_environment and running /system/bin/ls and $PREFIX/bin/ls and see if they work.

― Reply to this email directly, view it on GitHubhttps://github.com/termux/termux-app/issues/4219#issuecomment-2446085247, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2JO5Q3EU2ERNLVAELK2BMLZ6CFEPAVCNFSM6AAAAABQICARHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBWGA4DKMRUG4. You are receiving this because you authored the thread.Message ID: @.***>

agnostic-apollo commented 3 weeks ago

Another report. Report to OnePlus.

Bootstrap Error /data/data/com.termux/files/usr/etc/termux/bootstrap/termux-bootstrap-second-stage.sh: line 91: 26680 Killed ln -s "termux-bootstrap-second-stage.sh" "/data/data/com.termux/files/usr/etc/termux/bootstrap/termux-bootstrap-second-stage.sh.lock" 2> /dev/null RELEASE: 15
BRAND: OnePlus
MODEL: CPH2619

256-1 commented 2 weeks ago

I had the same issue on my OnePlus 13 with ColorOS 15 when using the github version Termux. After trying GooglePlayStore version it now works, no killed info. But when I tried to use proot-distro to intall ubuntu, it failed. Here enclosed with the capture and log when using the GooglePlayStore version. Screenshot_2024-11-08-10-50-46-61_84d3000e3f4017145260f7618db1d683 Screenshot_2024-11-08-10-48-28-64_6431dcd7adc47d9b8b1ef172f656a796 Screenshot_2024-11-08-10-18-43-91_84d3000e3f4017145260f7618db1d683.jpg

agnostic-apollo commented 2 weeks ago

proot-distro is not going to work, it unsets $LD_PRELOAD that has libtermux-exec.so, which internally is what uses the system_linker_exec hack to normally run executables so that they appear to be run from the system partition instead of the app data directory, the later is what's detected to be malicious, and proot-distro would be running processes the same way.

https://github.com/termux/proot-distro/blob/2abfb39d2e3e17e00a9a57187a036cd10a1e3742/proot-distro.sh#L96

chongxs commented 2 weeks ago

在使用 github 版本 Termux 时,我在装有 ColorOS 13 的 OnePlus 15 上遇到了同样的问题。尝试 GooglePlayStore 版本后,它现在可以工作了,没有杀死的信息。但是当我尝试使用 proot-distro 来安装 ubuntu 时,它失败了。此处包含使用 GooglePlayStore 版本时的捕获和日志。 Screenshot_2024-11-08-10-50-46-61_84d3000e3f4017145260f7618db1d683 Screenshot_2024-11-08-10-48-28-64_6431dcd7adc47d9b8b1ef172f656a796 Screenshot_2024-11-08-10-18-43-91_84d3000e3f4017145260f7618db1d683.jpg

google play 安装的版本比 F-droid 的版本低,但至少能打开。F-droid 安装版本受限于网络,需要bootstrap……同一加13用户,还没找到比较好用方式

dipankr commented 2 weeks ago

在使用 github 版本 Termux 时,我在装有 ColorOS 13 的 OnePlus 15 上遇到了同样的问题。尝试 GooglePlayStore 版本后,它现在可以工作了,没有杀死的信息。但是当我尝试使用 proot-distro 来安装 ubuntu 时,它失败了。此处包含使用 GooglePlayStore 版本时的捕获和日志。 Screenshot_2024-11-08-10-50-46-61_84d3000e3f4017145260f7618db1d683 Screenshot_2024-11-08-10-48-28-64_6431dcd7adc47d9b8b1ef172f656a796 Screenshot_2024-11-08-10-18-43-91_84d3000e3f4017145260f7618db1d683.jpg

google play 安装的版本比 F-droid 的版本低,但至少能打开。F-droid 安装版本受限于网络,需要bootstrap……同一加13用户,还没找到比较好用方式

Avoid using the play store version as it is clearly mentioned on the termux github repo that there are some known issues with that version and it is suggested to use the version from github or fdroid

ascopes commented 2 weeks ago

Is there a way to get this working without ADB? Or is this a complete issue with running subprocesses on any Android device now with OxygenOS?

Disabling process restrictions in developer settings makes zero difference for me.

Screenshot_2024-11-11-07-38-58-33_84d3000e3f4017145260f7618db1d683 Screenshot_2024-11-11-07-38-46-01_fc704e6b13c4fb26bf5e411f75da84f2

ascopes commented 2 weeks ago

Crash log: termux-crash_report.log

rjose-evertz commented 2 weeks ago

The latest update to termux from Google Play Store (not f droid) seems. To resolve the issues

libinanshu commented 2 weeks ago
W login   : type=1400 audit(0.0:6583): avc:  granted  { execute } for  path="/data/data/com.termux/files/usr/bin/dash" dev="dm-74" ino=602426 scontext=u:r:untrusted_app_27:s0:c57,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c57,c258,c512,c768 tclass=file app=com.termux
E OPLUS_KEVENT_RECORD: oplus_kevent Receive message from kernel, event_type=3
E OPLUS_KEVENT_RECORD: OPLUS_KEVENT payload:10569,path@@/data/data/com.termux/files/usr/bin/dash
I OPLUS_KEVENT_RECORD: oplus_put_exec_kevent_to_list
W login   : type=1400 audit(0.0:6584): avc:  granted  { execute } for  name="bash" dev="dm-74" ino=602768 scontext=u:r:untrusted_app_27:s0:c57,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c57,c258,c512,c768 tclass=file app=com.termux
E OPLUS_KEVENT_RECORD: oplus_kevent Receive message from kernel, event_type=3
E OPLUS_KEVENT_RECORD: OPLUS_KEVENT payload:10569,path@@/data/data/com.termux/files/usr/bin/dash
I OPLUS_KEVENT_RECORD: oplus_put_exec_kevent_to_list
E OPLUS_KEVENT_RECORD: oplus_kevent Receive message from kernel, event_type=3
E OPLUS_KEVENT_RECORD: OPLUS_KEVENT payload:10569,path@@/data/data/com.termux/files/usr/bin/dash
I OPLUS_KEVENT_RECORD: oplus_put_exec_kevent_to_list

The logs didn't reveal anything new. The linker error doesn't exist now. It could be OnePlus specific killer via OPLUS_KEVENT_RECORD that's killing the process, its known to kill processes running with proot, but there should be some additional entries for the killing, maybe they are not being logged due to rate limit. If its a OnePlus issue like it is for proot, there is nothing we can do, report to OnePlus.

Run adb shell "logcat -c" again and then get bash killed 5-6 times and then generate a dump again. Also try going into failsafe session and running /system/bin/ls and $PREFIX/bin/ls and see if they work.

Not only Android 15 of OnePlus phones, but also Honor and OPPO Android 15 are like this.

SplicedNZ commented 1 week ago

proot-distro is not going to work, it unsets $LD_PRELOAD that has libtermux-exec.so, which internally is what uses the system_linker_exec hack to normally run executables so that they appear to be run from the system partition instead of the app data directory, the later is what's detected to be malicious, and proot-distro would be running processes the same way.

https://github.com/termux/proot-distro/blob/2abfb39d2e3e17e00a9a57187a036cd10a1e3742/proot-distro.sh#L96

Do you think it's possible to prevent proot-distro from overriding $LD_PRELOAD? or is that required for proot to work?

I wonder if rooted, moving termux to the system partition might be a quick fix?

hamjin commented 1 week ago

Unlock the Bootloader and everything goes well on OnePlus 13

SplicedNZ commented 1 week ago

Unlock the Bootloader and everything goes well on OnePlus 13

Which version did you install, playstore? Do you mind testing if proot works?

256-1 commented 1 week ago

Good news ! I just received the latest OS update, termux(github version) works again, seems OnePlus fixed this issue.Screenshot_2024-11-13-22-46-35-03_84d3000e3f4017145260f7618db1d683.jpg

Screenshot_2024-11-13-22-45-00-18_9492aa3750dca76abb7c25b39a5f1e8e.jpg

agnostic-apollo commented 1 week ago

That's great news, what's the security update/patch date? You should likely be able to see it by clicking the right arrow in your last image or in Termux settings about.

SplicedNZ commented 1 week ago

@256-1 Thats encouraging! would you mind testing proot? Its maybe a bit off-topic but if you wouldn't mind testing winlator? It would be a big help for many Oneplus/ Oppo users.

256-1 commented 1 week ago

That's great news, what's the security update/patch date? You should likely be able to see it by clicking the right arrow in your last image or in Termux settings about.

The latest ColorOS version is PJZ110_15.0.0.209(CN01), they did't mention anything about this fix in the comments.

IMG_20241114_064344.jpg

Here is the about page in termux.

Screenshot_2024-11-14-06-55-40-84_84d3000e3f4017145260f7618db1d683.jpg

256-1 commented 1 week ago

@256-1 Thats encouraging! would you mind testing proot? Its maybe a bit off-topic but if you wouldn't mind testing winlator? It would be a big help for many Oneplus/ Oppo users.

I am not a winlator user, but I tried to install and run. It seems working fine.

IMG_20241114_064839.jpg

Screenshot_2024-11-14-06-47-16-70_b6022cb7d1a61f21e4fe914c8728a54c.jpg

Arkuarius commented 1 week ago

That's great news, what's the security update/patch date? You should likely be able to see it by clicking the right arrow in your last image or in Termux settings about.

The latest ColorOS version is PJZ110_15.0.0.209(CN01), they did't mention anything about this fix in the comments.

IMG_20241114_064344.jpg

Here is the about page in termux.

Screenshot_2024-11-14-06-55-40-84_84d3000e3f4017145260f7618db1d683.jpg

Oooh would ya look at that, the Android 15 kernel! Seems like they finally listened.

agnostic-apollo commented 1 week ago

The latest ColorOS version is PJZ110_15.0.0.209(CN01), they did't mention anything about this fix in the comments.

Thanks for the info. Security patch seems to be from last month, I guess its just an update to their own ROM. The ColorOS version would vary on different models. Likely getprop ro.build.date should be a better indicator of if someone is using the fixed update.

256-1 commented 1 week ago

The latest ColorOS version is PJZ110_15.0.0.209(CN01), they did't mention anything about this fix in the comments.

Thanks for the info. Security patch seems to be from last month, I guess its just an update to their own ROM. The ColorOS version would vary on different models. Likely getprop ro.build.date should be a better indicator of if someone is using the fixed update.

It is Sat Nov 9 01:47:07 CST 2024.Screenshot_2024-11-15-07-00-03-76_84d3000e3f4017145260f7618db1d683.jpg

agnostic-apollo commented 1 week ago

Thanks.

ascopes commented 1 week ago

What does this mean for those not using ColorOS? E.g. I'm on a OnePlus 12 Pro with OxygenOS (no root)... what are the steps to get this working?

weaponmasterjax commented 1 week ago

What does this mean for those not using ColorOS? E.g. I'm on a OnePlus 12 Pro with OxygenOS (no root)... what are the steps to get this working?

update your system. The problem is already fixed on latest oos15.

laughingwater commented 1 week ago

Screenshot_2024-11-17-01-01-23-59_9492aa3750dca76abb7c25b39a5f1e8e

What does this mean for those not using ColorOS? E.g. I'm on a OnePlus 12 Pro with OxygenOS (no root)... what are the steps to get this working?

update your system. The problem is already fixed on latest oos15.

In the OOS15 CBT, termux nor winlator work for me, (termux had the issue of getting killed (code9) so I tried reinstalling and now it fails to install bootstrap packages) [OnePlus 12 (IN version)]

twaik commented 1 week ago

@laughingwater install to internal memory, not to sdcard or expanded storage.

ascopes commented 1 week ago

@twaik OnePlus 12 devices only have internal storage by default though.

@weaponmasterjax so if OxygenOS is reporting itself as up to date, we have to assumably wait until the next OS update (usually every month or two)?

laughingwater commented 1 week ago

@laughingwater install to internal memory, not to sdcard or expanded storage.

I don't have external storage, it's installed to internal memory.

laughingwater commented 1 week ago

@twaik OnePlus 12 devices only have internal storage by default though.

@weaponmasterjax so if OxygenOS is reporting itself as up to date, we have to assumably wait until the next OS update (usually every month or two)?

Yeah if anything ends up happening in the CBT I'll let you guys know

ascopes commented 1 week ago

@laughingwater thanks

DayDve commented 1 week ago

I have same issue. termux-report_issue_from_transcript.log

DvdBr3o commented 3 days ago

Same issue on OnePlus Pad Pro. My pad has recently been updated to ColorOS 15 (xxx.201 tho).

Screenshot_2024-11-23-02-58-17-30_9492aa3750dca76abb7c25b39a5f1e8e.jpg

The f-droid version termux failed to install bootstrap packages, while the google play version can be installed right. But the google play version still receivd signal 9 when installing proot-distro distributions (something with tarball child process):

Screenshot_2024-11-23-02-51-14-24_84d3000e3f4017145260f7618db1d683.jpg

btw, in ColorOS 14 it will pop up a warning when it encountered permission denied. In ColorOS 15 it is just killed without warning...

paulmorabito commented 2 days ago

Same issue with OOS 15 on OnePlus Pad 2.

ascopes commented 1 day ago

Can confirm the Google Play version worked for me.

laughingwater commented 1 hour ago

Screenshot_2024-11-26-22-31-55-91_9492aa3750dca76abb7c25b39a5f1e8e.jpg

Guys, I just got the .305 update, termux and winlator work as before again!!

Arkuarius commented 34 minutes ago

Awesome