Qt Creator, ptrace: Operation not permitted. What is the permanent solution?

天涯浪子 提交于 2019-11-29 19:42:46

If running Ubuntu,

The recommended way to enable the needed ptrace kernel setting (hinted by qtcreator) is to edit /etc/sysctl.d/10-ptrace.conf

sudo vim  /etc/sysctl.d/10-ptrace.conf

Then change

kernel.yama.ptrace_scope = 1

to

kernel.yama.ptrace_scope = 0

Save,

then apply:

$ sudo sysctl --system -a -p|grep yama
kernel.yama.ptrace_scope = 0

run

man sysctl

for more info.

I got the answer.

  • Go to the location /etc with root privilege.

  • Find the file rc.local.

  • Open it in a text editor like gedit and add the following code there
  • echo 0 | tee /proc/sys/kernel/yama/ptrace_scope

Restart your pc and you can see the debugger working perfectly.

Ehsan Sadr

I found the answer that works for me on ubuntu in below link and the credit goes to dstzcxr

https://askubuntu.com/a/501271/395583

Just uncheck (or check - run - uncheck if it is for some reason unchecked) the box "Run in terminal" in "Projects" (on the left bar) - "Run" tab - "Run" section.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!