From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24683 invoked by alias); 11 May 2010 22:28:00 -0000 Received: (qmail 24674 invoked by uid 22791); 11 May 2010 22:27:59 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,TW_EG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 11 May 2010 22:27:55 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 0F8854B06D; Tue, 11 May 2010 15:27:54 -0700 (PDT) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost3.vmware.com (Postfix) with ESMTP id F29B8CD905; Tue, 11 May 2010 15:27:53 -0700 (PDT) Message-ID: <4BE9D9E9.5020806@vmware.com> Date: Tue, 11 May 2010 22:28:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.22 (X11/20090609) MIME-Version: 1.0 To: Pedro Alves CC: "gdb-patches@sourceware.org" , Hui Zhu Subject: Re: [RFA] Checkpoint: wait the defunct process when delete it References: <201005110030.09328.pedro@codesourcery.com> <4BE9D122.1090803@vmware.com> In-Reply-To: <4BE9D122.1090803@vmware.com> Content-Type: multipart/mixed; boundary="------------090003070006010402010308" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00251.txt.bz2 This is a multi-part message in MIME format. --------------090003070006010402010308 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 702 Michael Snyder wrote: > Pedro Alves wrote: >> On Sunday 09 May 2010 07:23:15, Hui Zhu wrote: >> >>> I found that when we delete the checkpoint process, it keep defunct. >>> This is because the parent process is still running and didn't wait >>> it. >>> So I add a wait_ptid function after ptrace kill. >> You're assuming inferior_ptid is the parent process >> of the checkpoint fork, but I don't believe that is always >> true. > > Correct. Maybe we should add a "parent ID" field to the > internal checkpoint table? Hui, Here's a small change that saves the parent PTID. Can you combine this with your change, to make sure that waitpid is called by the correct process? Good luck, Michael --------------090003070006010402010308 Content-Type: text/plain; name="fork.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fork.txt" Content-length: 756 Index: linux-fork.c =================================================================== RCS file: /cvs/src/src/gdb/linux-fork.c,v retrieving revision 1.32 diff -u -p -r1.32 linux-fork.c --- linux-fork.c 5 May 2010 20:37:23 -0000 1.32 +++ linux-fork.c 11 May 2010 22:26:08 -0000 @@ -47,6 +47,7 @@ struct fork_info { struct fork_info *next; ptid_t ptid; + ptid_t parent_ptid; int num; /* Convenient handle (GDB fork id) */ struct regcache *savedregs; /* Convenient for info fork, saves having to actually switch contexts. */ @@ -596,6 +597,7 @@ checkpoint_command (char *args, int from if (!fp) error (_("Failed to find new fork")); fork_save_infrun_state (fp, 1); + fp->parent_ptid = last_target_ptid; } static void --------------090003070006010402010308--