From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13959 invoked by alias); 7 Mar 2013 10:14:03 -0000 Received: (qmail 13942 invoked by uid 22791); 7 Mar 2013 10:14:03 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Mar 2013 10:13:57 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r27ADtGn030129 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Mar 2013 05:13:55 -0500 Received: from host2.jankratochvil.net (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r27ADpTq020630 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 7 Mar 2013 05:13:53 -0500 Date: Thu, 07 Mar 2013 10:14:00 -0000 From: Jan Kratochvil To: "Metzger, Markus T" 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] Message-ID: <20130307101350.GA14969@host2.jankratochvil.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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/msg00274.txt.bz2 On Thu, 07 Mar 2013 10:59:23 +0100, Metzger, Markus T wrote: > > -----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 target to > > disable tracing and all I would need to do is remove the tcomplain call in > > target_disable_btrace. > > > > 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) == 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. OK, I agree target_close seems excessive here, it also does not correspond 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. Thanks, Jan