'strace' 命令的两个应用程序之间的 Uid 问题

Uid issues between two applications for the 'strace' command

我将在两个应用程序之间使用 strace -p <myPid> 命令。

但是,strace 命令不适用于其他应用程序(它本身运行良好)。

这是错误信息:

attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted
Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf

如果因为uid的不同而出现命令错误,我可以修复修改uid吗?

或者有其他解决办法吗?

这个问题我没有完全解决,有一些问题想通了。

此问题与 setUid 权限和 android SE 有关。

首先,然后构建一个android版本4.0.3,所以我刷了一个镜像文件给参考Phone。

并且给了setUid STRACE的权限后,效果很好。(androidSE是4.3以上发布的)

然而,版本 4.4.2 android SE 阻止了访问过程。 (Galaxy系列无法发布,因为androidSE和KNOX相互影响。)

不幸的是,现在我没有额外的参考 phone,关闭 android SE,我无法尝试 运行 命令 STRACE。(我会尽快更新。)