Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 5 Sep 2002 18:25:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 5 Sep 2002 18:25:14 -0400 Received: from crack.them.org ([65.125.64.184]:2821 "EHLO crack.them.org") by vger.kernel.org with ESMTP id ; Thu, 5 Sep 2002 18:25:13 -0400 Date: Thu, 5 Sep 2002 18:29:47 -0400 From: Daniel Jacobowitz To: Ingo Molnar Cc: OGAWA Hirofumi , Linus Torvalds , linux-kernel@vger.kernel.org Subject: Re: [patch] ptrace-fix-2.5.33-A1 Message-ID: <20020905222947.GA13667@nevyn.them.org> Mail-Followup-To: Ingo Molnar , OGAWA Hirofumi , Linus Torvalds , linux-kernel@vger.kernel.org References: <20020905221558.GA12837@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2228 Lines: 47 On Fri, Sep 06, 2002 at 12:25:32AM +0200, Ingo Molnar wrote: > > On Thu, 5 Sep 2002, Daniel Jacobowitz wrote: > > > Right - let me rephrase. Tasks which are either: > > - untraced, normal > > - traced, but traced _by their parent_ > > are on the sibling/children list. > > hm, why the distinction along whether the debugger == real parent? What > wrong can happen if we always move traced tasks to the ptrace list? The > task will be both in the ptrace list and in the parent's child list, and > everything should work as expected. This looks a more symmetric and > simpler thing to me. Hmm, I like that idea. But I was talking about current implementation. If we want to do this then we'd need to fix up every ptrace implementation in every architecture to call the appropriate function; it's a separate problem. > > > this splitup of the lists makes it possible for the debugger to do a wait4 > > > that will get events from the debugged task, and for the debugged task to > > > also be available to the real parent. > > > > Great. I'm not exactly sure on how this works right now: sys_wait4 only > > iterates over ->children, with the exception of the special code in > > TASK_ZOMBIE. I'm not quite sure when events from a traced process get > > to the normal parent of that process, or when they're supposed to. > > i'm not sure about this either. What happens if an (untraced) parent has > traced and untraced children, and does a wait4. Would it confuse the > debugger if the parent could get one of the traced tasks as a result in > wait4? And how does the debugger solve this problem? Well, it seems to me that when a traced task has an event, it should be reported first to the debugger - for signals this happens in do_signal - and then possibly to the normal parent. But I'm not sure if this actually happens right now or not. Worth investigating some more. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/