# gdb
GNU gdb (GDB) Red Hat Enterprise Linux 。。。
(gdb) attach 進程id
# gdb -p 進程id
上面兩種操作的效果 是一樣的。
# ps -ef | grep restart| grep -v "grep"
# ps -ef | grep [r]estart
# restart 是進程名
上面兩種操作的效果 是一樣的。
要查看一個殭屍進程是怎麼產生的,結果出現了下面的現象
# gdb -p 28535
GNU gdb (GDB) Red Hat Enterprise Linux .....
Attaching to process 28535
warning: process 28535 is a zombie - the process has already terminated
ptrace: Operation not permitted.
(gdb) quit
意思是我沒有權限操作,我查看了自己是root用戶,並查看是否有其他人調用了gdb,就不能再打開,必須kill掉原來的
# ps -aux | grep gdb | grep -v "grep"
然而,結果是空的,也就是沒有其他人在操作gdb,還有人說是文件的操作權限問題
chmod +s /usr/bin/gdb
依然沒有效果。。。
有人說修改一下文件內容
echo 0 > /proc/sys/kernel/yama/ptrace_scope
但是我查看這個文件裏的內容本身就是0,依然沒有效果。。。最終還是沒有查到解決辦法。
strace -p 進程id
ptrace -p 進程id