Sample Header Ad - 728x90

ptrace: Operation not permitted when attaching to a zombie process

1 vote
1 answer
6165 views
I have a reproducible situation where a compiler instance goes into a zombie state when I rebuild a package, but gdb won't permit me to attach: serenity ~ # ps ax | grep defunct 11351 pts/1 Z+ 0:00 [x86_64-pc-linux] 21838 pts/5 S+ 0:00 grep --colour=auto defunct serenity ~ # gdb -p 11351 GNU gdb (Gentoo 7.10.1 vanilla) 7.10.1 [snip] Attaching to process 11351 warning: process 11351 is a zombie - the process has already terminated ptrace: Operation not permitted. (gdb) [This question](https://stackoverflow.com/questions/19215177/gdb-ptrace-operation-not-permitted) suggests the problem is with proc.sys.kernel.yama.ptrace_scope, or that I might not be root, but that sysctl isn't present on my system, and I _am_ running as root: serenity ~ # sysctl -a | grep ptrace sysctl: reading key "net.ipv6.conf.all.stable_secret" sysctl: reading key "net.ipv6.conf.default.stable_secret" sysctl: reading key "net.ipv6.conf.enp4s0.stable_secret" sysctl: reading key "net.ipv6.conf.lo.stable_secret" serenity ~ # whoami root serenity ~ # For reference, my kernel version is 4.9.16-gentoo.
Asked by Michael Mol (937 rep)
May 30, 2017, 08:18 PM
Last activity: Dec 23, 2019, 08:23 PM