From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22346 invoked by alias); 7 Mar 2013 12:33:56 -0000 Received: (qmail 22336 invoked by uid 22791); 7 Mar 2013 12:33:55 -0000 X-SWARE-Spam-Status: No, hits=-8.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Mar 2013 12:33:46 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 07 Mar 2013 04:33:46 -0800 X-ExtLoop1: 1 Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga001.fm.intel.com with ESMTP; 07 Mar 2013 04:33:45 -0800 Received: from irsmsx152.ger.corp.intel.com (163.33.192.66) by IRSMSX104.ger.corp.intel.com (163.33.3.159) with Microsoft SMTP Server (TLS) id 14.1.355.2; Thu, 7 Mar 2013 12:32:17 +0000 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.244]) by IRSMSX152.ger.corp.intel.com ([169.254.6.185]) with mapi id 14.01.0355.002; Thu, 7 Mar 2013 12:32:16 +0000 From: "Metzger, Markus T" To: Jan Kratochvil CC: "gdb-patches@sourceware.org" , "markus.t.metzger@gmail.com" , "Himpel, Christian" Subject: RE: Crash of GDB with gdbserver btrace enabled [Re: [patch v9 00/23] branch tracing support for Atom] Date: Thu, 07 Mar 2013 12:33:00 -0000 Message-ID: References: <20130306124334.GA29994@host2.jankratochvil.net> <20130306170622.GA25771@host2.jankratochvil.net> <20130307090632.GA11095@host2.jankratochvil.net> <20130307101350.GA14969@host2.jankratochvil.net> <20130307120644.GA21253@host2.jankratochvil.net> In-Reply-To: <20130307120644.GA21253@host2.jankratochvil.net> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 2013-03/txt/msg00284.txt.bz2 > -----Original Message----- > From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] > Sent: Thursday, March 07, 2013 1:07 PM > > > OK, I agree target_close seems excessive here, it also does not corre= spond to > > > the current description of target_close: > > > This routine is automatically always called after popping the target > > > off the target stack > > > > > > While it is nice cleanup I find it a separate patch, not required for= btrace. > > > > With this patch, the crash is gone with only minimal changes to btrace. >=20 > It is only a coincidence and workaround of it. Hmmm, if we must no longer call methods in a certain target, why is removing that target a workaround? Pedro already moved the target_close call after removing the target in http://sourceware.org/ml/gdb-patches/2012-01/msg00701.html. He just did not consider the extra target_close call in pop_target, which is not only closing the target twice but also breaking his attempt to reorder target removing and closing. If we removed disabling btrace from to_close, we would need to add a separate path for "record stop". This means adding two new target methods in total - one for clear/teardown and one for record stop. It would further break the symmetry with to_open. Tracing would be enabled in to_open but it would not be disabled in to_close, any more. We also must not clear btrace in to_close since this would prevent btrace from actually being disabled when the threads are discarded sometime after the record target has been unpushed. We would thus leave threads traced after the record target is gone and rely on thread cleanup to do the actual disabling. This does not feel right. Markus. Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052