Discussion:
Could not attach debugger
Mahmood Naderan
2011-06-24 12:17:49 UTC
Permalink
Hi
When I to attach a process to gdb in kdevelop I get this error

Could not attach debugger:
ptrace: Operation not permitted.

What should I do?
--
// Naderan *Mahmood;
Milian Wolff
2011-06-24 12:45:48 UTC
Permalink
Post by Mahmood Naderan
Hi
When I to attach a process to gdb in kdevelop I get this error
ptrace: Operation not permitted.
What should I do?
Google for the error message and change the ptrace settings:

fromt the very first hit:

"And the solution is just either do this (as root):

$ echo 0 > /proc/sys/kernel/yama/ptrace_scope


or make it permanent by setting ptrace_scope to 0 in /etc/sysctl.d/10-
ptrace.conf"

see also:

https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace_Protection
--
Milian Wolff
mail-***@public.gmane.org
http://milianw.de
Mahmood Naderan
2011-06-24 13:09:53 UTC
Permalink
ok thanks I thought it is a kdevelop specific message.
it is now fixed
--
// Naderan *Mahmood;
Chris Bruner
2011-06-24 13:39:38 UTC
Permalink
$ echo 0> /proc/sys/kernel/yama/ptrace_scope
…or make it permanent by setting ptrace_scope to 0 in /etc/sysctl.d/10-
ptrace.conf"
https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace_Protection
Unfortunately my kernel doesn't know anything about yama. My solution
was to run it as root. It's a security fix so a debugger can't access
other owner's pids. Becomes a big pitb for anyone doing debugging.




=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 7.0.0.18, Virus/Spyware Database: 6.17790)
http://www.pctools.com/
=======

Continue reading on narkive:
Loading...