adb android native shell valgrind

Android, start valgrind permission denied when launched under logwrapper

I’m trying to use valgrind on android, and have some problems. When I launch app under valgrind I got following errors(in logcat):

         logwrapper  W  type=1400 audit(0.0:73): avc: denied { execute } for name="" 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/ failed: Permission denied I executing /data/local/ failed: Permission denied
I terminated by exit(255)


  1. I builded valgring valgrind-3.13.0 on my machine and push it on
    rooted nexus 6P, 8.1.0 OS. (I also used emulator 8.0 +
    valgrind-3.11.0 – same effect)
  2. I set prop adb shell setprop wrap.$PACKAGE \"logwrapper /data/local/\" ( script
    from below link)
  3. I used instructions from here .
  4. I did chmod -R 777 /data/local/Inst/ (location for valgrind bin).
  5. I did chmod 777 /data/local/ (start script, see 2 item)
  6. I launched app like that: adb shell am start -a android.intent.action.MAIN -n $PACKAGE/.MainActivity
  7. I use Hello world native JNI app.

Maybe problem that logwrapper can not start script /data/local/ due to that fact that it does not have enouph permissions, but how to add those permissions.?