【发布时间】:2018-05-27 07:42:08
【问题描述】:
我正在尝试在 android 上使用 valgrind,但遇到了一些问题。当我在valgrind 下启动应用程序时,出现以下错误(在 logcat 中):
logwrapper W type=1400 audit(0.0:73): avc: denied { execute } for name="start_valgrind.sh" dev="dm-1" ino=654102 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:system_data_file:s0 tcla ss=file permissive=0
E executing /data/local/start_valgrind.sh failed: Permission denied
start_valgrind.sh I executing /data/local/start_valgrind.sh failed: Permission denied
I start_valgrind.sh terminated by exit(255)
前提条件:
- 我在我的机器上构建了 valgring valgrind-3.13.0 并推动它 根系 6P,8.1.0 操作系统。 (我也使用了模拟器 8.0 + valgrind-3.11.0 - 效果一样)
- 我设置了 prop
adb shell setprop wrap.$PACKAGE \"logwrapper /data/local/start_valgrind.sh\"(start_valgrinds.sh 脚本 从下面的链接) - 我使用了这里的指令 https://stackoverflow.com/a/19235439/313113 。
- 我做了
chmod -R 777 /data/local/Inst/(valgrind bin 的位置)。 - 我做了
chmod 777 /data/local/start_valgrind.sh(启动脚本,见2项) - 我启动了这样的应用程序:
adb shell am start -a android.intent.action.MAIN -n $PACKAGE/.MainActivity - 我使用 Hello world 原生 JNI 应用。
可能是logwrapper 无法启动脚本/data/local/start_valgrind.sh 的问题,因为它没有足够的权限,但是如何添加这些权限。?
【问题讨论】:
-
你找到解决办法了吗?
-
@ArturLatoszewski 还没有,等到更好的时候再说吧。
-
你一直在 OSX 上构建 valgrind 吗?你用过哪个版本的NDK?
-
OSX,ndk 版本很可能是 r12b,不过不确定是否重要。
标签: android shell adb native valgrind