博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
gdb attach fails with ptrace: Operation not permitted
阅读量:7210 次
发布时间:2019-06-29

本文共 957 字,大约阅读时间需要 3 分钟。

[COPY FROM  ]

处理办法一:

Today I ran into a weird problem. I could not attach to my own process with gdb. The process ran under my UID, but gdb refused to attach. This is a problem of wrong permissions, although/proc/[pid]/status looked ok:

...Uid:    1000    1000    1000    1000Gid:    1000    1000    1000    1000...

I am the owner but cannot attach? Well, I launched gdb as root and could attach. Strange. Without digging deeper into this, my dirty workaround was this:

sudo chmod +s /usr/bin/gdb

Update: Thanks to Mario, who pointed out, that the reason is the Kernel hardening stuff build into the Ubuntu kernel. See  how to fix the problem permanently.

 

处理办法二:

I found the issue:

And the solution is just either do this (as root):

$ echo 0 > /proc/sys/kernel/yama/ptrace_scope

…or make it permanent by setting ptrace_scope to 0 in /etc/sysctl.d/10-ptrace.conf

Hope you find it useful!

转载于:https://www.cnblogs.com/MagicLetters/archive/2011/11/17/4382781.html

你可能感兴趣的文章
java 实现类似于python requests包的Session类,自动管理cookie。
查看>>
Dubbo简介2
查看>>
cityspace
查看>>
node服务器中打开html文件的两种方法
查看>>
eclipse 将javaWeb项目转化成maven项目
查看>>
idea常用快捷键
查看>>
公网用户接入NAT后面的freeswitch配置
查看>>
nodejs笔记
查看>>
springboot项目中jdk版本的问题
查看>>
c#之多线程之为所欲为
查看>>
调整窗口大小时进行页面刷新(设定定时器)
查看>>
将SSM架构中原来关于springSecurity3.x版本的写法配迁移到SpringBoot2.0框架中出现的问题解决记...
查看>>
SpringBoot自定义Filter
查看>>
sql server 高可用故障转移(6)
查看>>
asp.net core中IHttpContextAccessor和HttpContextAccessor的妙用
查看>>
Type class-Typeclass-泛型基础上的二次抽象
查看>>
Qt之加减乘除四则运算-支持负数
查看>>
localStorage使用总结,页面跳转,保存值
查看>>
[Javascript] Replicate JavaScript Constructor Inheritance with Simple Objects (OLOO)
查看>>
数据结构2 - 线性表
查看>>