Re: [PATCH] cleanup ptrace stops and remove notify_parent

From: Andi Kleen
Date: Tue Aug 31 2004 - 05:01:22 EST


Roland McGrath <roland@xxxxxxxxxx> writes:

> This patch is against Linus's current tree.
>
> This adds a new state TASK_TRACED that is used in place of TASK_STOPPED
> when a thread stops because it is ptraced. Now ptrace operations are only
> permitted when the target is in TASK_TRACED state, not in TASK_STOPPED.
> This means that if a process is stopped normally by a job control signal
> and then you PTRACE_ATTACH to it, you will have to send it a SIGCONT before
> you can do any ptrace operations on it. (The SIGCONT will be reported to
> ptrace and then you can discard it instead of passing it through when you
> call PTRACE_CONT et al.)

Are you sure such a user visible semantic change is a good idea?

I at least have written (not very important, but existing) user space
code in the past that assumed it can stop and single step without
SIGCONT. I wouldn't be surprised if other debuggers ran into
the same issue.

And the Linux debugging world is not gdb only anymore, there are
a lot of other users of ptrace around these days ...

I don't think it is very good to change such behaviour in 2.6.
Please don't do it.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/