Skip to content

Instantly share code, notes, and snippets.

@motebaya
Last active February 23, 2024 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motebaya/39ea9a11ee2874809308130708391634 to your computer and use it in GitHub Desktop.
Save motebaya/39ea9a11ee2874809308130708391634 to your computer and use it in GitHub Desktop.
GDB: ptrace: Operation not permitted.
This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
Downloading separate debug info for /usr/bin/php7.4
(No debugging symbols found in /usr/bin/php7.4)                                               
(gdb) attach 350091
Attaching to program: /usr/bin/php7.4, process 350091
ptrace: Operation not permitted.
(gdb) quit

maybe this happened because run without root/sudo, so we need disable ptrace. but even i run with sudo/root the others prblm comes

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

Here full refference about yama ptrace restriction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment