Hacker News new | ask | show | jobs
by amelius 898 days ago
Except it doesn't work on programs that call strace.
1 comments

Why not? A simple "strace strace date" works on my machine.
Ok, well this used to be not the case.
It's always been the case, as far as I know. You may be thinking of the fact that you can't ptrace a process that's already being ptraced, which includes processes that are ptracing themselves.
Doesn't strace use the ptrace() system call under the hood?
Correct, which is why I'm mentioning it here. Stracing another instance of strace does not involve any of the processes ptracing themselves, though, and I don't think it ever has.
So they implemented recursion/reentrance as a special case?