Open Aakash16 opened 8 years ago
Unfortunately, trying to run sample-target
under strace
presents a bit of a chicken-and-egg problem.
strace
works by attaching to the target application using ptrace
. However, linux-inject
itself also needs to be able to attach to the target application using ptrace
. Two processes cannot ptrace
the same application at the same time, so linux-inject
can't attach when strace
is already attached.
As a result, you can't use linux-inject
on an application that is running under strace
.
Thank you for your reply. Now I understand the problem.
On 2/17/16, gaffe23 notifications@github.com wrote:
Unfortunately, trying to run
sample-target
understrace
presents a bit of a chicken-and-egg problem.
strace
works by attaching to the target application usingptrace
. However,linux-inject
itself also needs to be able to attach to the target application usingptrace
. Two processes cannotptrace
the same application at the same time, solinux-inject
can't attach whenstrace
is already attached.As a result, you can't use
linux-inject
on an application that is running understrace
.
Reply to this email directly or view it on GitHub: https://github.com/gaffe23/linux-inject/issues/5#issuecomment-184906899
Thanks for creating awesome injection library. I am able to successfully inject with help of your technique. But when I run sample-target with strace the injection fails with message: ptrace(PTRACE_ATTACH) failed please help.