Hi guys! First timer here, both on Crunchbang and the forum.
I need help in allowing gdb to debug a child process created with the fork command. The idea is to have 2 terminal with gdb, one running the parent process and the other one running the child. When I launch gdb using the PID of the child process it says: "ptrace: Operation not permitted". Also tried the attach command, same thing.
From what I could find there is a solution in Ubuntu, which is to change the value of the file /proc/sys/kernel/yama/ptrace_scope from 1 to 0. The problem is I can't find such a file or variable in Crunchbang.
My system info (I don't if that's enough, if not let me know ):
Linux crunchbang 3.2.0-4-686-pae #1 SMP Debian 3.2.35-2 i686 GNU/Linux
Thanks in advance!
PS: English isn't my native language, so corrections are welcome!
PR_SET_PTRACER (since Linux 3.4) This is only meaningful when the Yama LSM is enabled and in mode 1 ("restricted ptrace", visible via /proc/sys/kernel/yama/ptrace_scope). When a "ptracer process ID" is passed in arg2, the caller is declaring that the ptracer process can ptrace(2) the calling process as if it were a direct process ancestor. Each PR_SET_PTRACER operation replaces the previous "ptracer process ID". Employing PR_SET_PTRACER with arg2 set to 0 clears the caller's "ptracer process ID". If arg2 is PR_SET_PTRACER_ANY, the ptrace restrictions introduced by Yama are effectively disabled for the calling process. For further information, see the kernel source file Documentation/security/Yama.txt.
Seems like you need a more recent kernel for that.