gpt4 book ai didi

c++ - 为什么 gdb 不能附加到由 inetd 调用的服务器应用程序?

转载 作者:太空狗 更新时间:2023-10-29 19:55:39 26 4
gpt4 key购买 nike

我有一个服务器应用程序,可以使用 inetd 为客户端调用。但是,如果我尝试附加到使用 inetd 启动的服务器进程,我会收到以下响应:ptrace:不允许操作。

gdb --annotate=3 /my/app/here <processId>

Current directory is /usr/local/bin/
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Reading symbols from /usr/local/bin/flumed...done.
Using host libthread_db library "/lib/tls/libthread_db.so.1".
Attaching to program: /my/app/here, process <processId>
ptrace: Operation not permitted.
/usr/local/bin/<processId>: No such file or directory.
(gdb)

最佳答案

我的解决方案是这样的:

echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

关于c++ - 为什么 gdb 不能附加到由 inetd 调用的服务器应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1586812/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com