Valgrind Permission Denied
I am using clion on windows with wsl. All the tool chain stuff is working fine, and I can run my programs great. When I try to run with valgrind it aborts because of permission being denied. I get:
/mnt/c/Users/josh-laptop/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/bin/valgrind --tool=memcheck --xml=yes --xml-file=/mnt/c/Users/josh-laptop/AppData/Local/Temp/valgrind --gen-suppressions=all --leak-check=full --leak-resolution=med --track-origins=yes --vgdb=no /mnt/c/Users/josh-laptop/CLionProjects/wsl-test/cmake-build-debug/wsl_test
env: ‘/mnt/c/Users/josh-laptop/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/bin/valgrind’: Permission denied
Process finished with exit code 126
I've been messing around with chmod stuff to no avail, and I have purged and reinstalled valgrind etc. Any suggestions?


Please sign in to leave a comment.
Hello!
Could you please try use `/usr/bin/valgrind` valgrind executable?
Does it help?
If not, could you please try to open WSL and manually execute Valgrind command. in your case it should be
`/usr/bin/valgrind --tool=memcheck --xml=yes --xml-file=/mnt/c/Users/josh-laptop/AppData/Local/Temp/valgrind --gen-suppressions=all --leak-check=full --leak-resolution=med --track-origins=yes --vgdb=no /mnt/c/Users/josh-laptop/CLionProjects/wsl-test/cmake-build-debug/wsl_test`
Regards,
Maxim
Thank you! I think setting the file path for the valgrind executable to /usr/bin/valgrind instead of the absolute path from my C: drive fixed it!