From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6085 invoked by alias); 7 Mar 2013 10:00:11 -0000 Received: (qmail 6065 invoked by uid 22791); 7 Mar 2013 10:00:09 -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 mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Mar 2013 10:00:04 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 07 Mar 2013 02:00:02 -0800 X-ExtLoop1: 1 Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by azsmga001.ch.intel.com with ESMTP; 07 Mar 2013 02:00:01 -0800 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.244]) by IRSMSX104.ger.corp.intel.com ([169.254.5.19]) with mapi id 14.01.0355.002; Thu, 7 Mar 2013 09:59:23 +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 10:00:00 -0000 Message-ID: References: <1362416770-19750-1-git-send-email-markus.t.metzger@intel.com> <20130306124334.GA29994@host2.jankratochvil.net> <20130306170622.GA25771@host2.jankratochvil.net> <20130307090632.GA11095@host2.jankratochvil.net> In-Reply-To: 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/msg00271.txt.bz2 > -----Original Message----- > From: Metzger, Markus T > Sent: Thursday, March 07, 2013 10:41 AM > Another approach would be to change pop_target to unpush the top target > instead of just closing it. This would prevent btrace from finding a tar= get to > disable tracing and all I would need to do is remove the tcomplain call in > target_disable_btrace. >=20 > This would be quite elegant but I have no clue about the side effects this > might have. void pop_target (void) { target_close (target_stack, 0); /* Let it clean up. */ if (unpush_target (target_stack) =3D=3D 1) return; fprintf_unfiltered (gdb_stderr, "pop_target couldn't find target %s\n", current_target.to_shortname); internal_error (__FILE__, __LINE__, _("failed internal consistency check")); } Isn't pop_target closing the topmost target twice? When I remove the first call to target_close and do not turn errors into warnings in record_btrace_close, the crash is gone. I have no clue about the side effects of this, though. Regards, 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