70 gdb attach $pid, process 2021 is already traced by process 2019
前言
因为此时 insmod 进程卡住了, 因此 我想 gdb attach 上去看一下 堆栈信息
但是 attach 的时候失败了, 提示信息如下
root@ubuntu:~/linux/linux-4.10.14# gdb attach 2021
GNU gdb (GDB) 10.2For help, type "help".
Type "apropos word" to search for commands related to "word"...
attach: No such file or directory.
Attaching to process 2021
warning: process 2021 is already traced by process 2019
ptrace: Operation not permitted.
/root/linux/linux-4.10.14/2021: No such file or directory.
解决方式
杀掉 stace 进程, 然后 再 attach 一下就可以了
root@ubuntu:~/linux/linux-4.10.14# gdb attach 2021
GNU gdb (GDB) 10.2For help, type "help".
Type "apropos word" to search for commands related to "word"...
attach: No such file or directory.
Attaching to process 2021
Reading symbols from /bin/kmod...
(No debugging symbols found in /bin/kmod)
Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...
(No debugging symbols found in /lib/x86_64-linux-gnu/libc.so.6)
Reading symbols from /lib64/ld-linux-x86-64.so.2...
(No debugging symbols found in /lib64/ld-linux-x86-64.so.2)
0x00007f6b88a185d9 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0 0x00007f6b88a185d9 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x000055dacbed8b0f in ?? ()
#2 0x000055dacbec8e37 in ?? ()
#3 0x00007f6b88937840 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x000055dacbec8339 in ?? ()
(gdb) info threadsId Target Id Frame
* 1 process 2021 "insmod" 0x00007f6b88a185d9 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
完