Qdebug Error in qt 5.1 on ubuntu

On my ubuntu machine, i received this error while starting debugging in qt 5.1 .

 

Could not attach to the process. Make sure no other debugger traces this process.

Check the settings of

/proc/sys/kernel/yama/ptrace_scope

For more details, see /etc/sysctl.d/10-ptrace.conf

 

This has been reported as a bug in qt project site .

Temporary solution from bug forum

Temporary workaround (note that this introduces security risk to your system, see Ubuntu wiki page linked above for details):
In /etc/sysctl.d/10-ptrace.conf change value of kernel.yama.ptrace_scope to 0. This file is read at startup time so you will need to reboot to apply change.
You can also set ptrace_scope to 0 for current session only (it will revert back to 1 after rebooting) like this:

 echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

 

Debug error in qtcreator

I generally use eclipse in my ubuntu box. This afternoon i decided to use qtcreator for a change. Found a annoying bug in qdebug for console application , which is due to some security changes in ubuntu .

Here is the error….

ptrace: Operation not permitted.

Could not attach to the process. Make sure no other debugger traces this process.
Check the settings of
/proc/sys/kernel/yama/ptrace_scope
For more details, see /etc/sysctl.d/10-ptrace.conf

Solution :

1. Open command line and move to this folder

cd /etc/sysctl.d/
2. Edit this file

sudo nano 10-ptrace.conf
3. change the value of
kernel.yama.ptrace_scope = 0

Thats it 🙂