From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27731 invoked by alias); 7 Mar 2013 09:06:48 -0000 Received: (qmail 27719 invoked by uid 22791); 7 Mar 2013 09:06:46 -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 09:06:39 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2796bPL004437 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Mar 2013 04:06:37 -0500 Received: from host2.jankratochvil.net (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2796W6Q013948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 7 Mar 2013 04:06:35 -0500 Date: Thu, 07 Mar 2013 09:06: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: <20130307090632.GA11095@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> 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/msg00265.txt.bz2 On Wed, 06 Mar 2013 19:07:42 +0100, Metzger, Markus T wrote: > I'm not quite sure what the OS will do if tracing is requested twice for the same > thread, i.e. repeated "record stop" followed by "record btrace" . We may get > an error or we may get a second buffer, thus leaking resources (i.e. the mmapped > trace buffer). We will need another target method to disable branch tracing > that is called by the "record stop" command. Yes, thanks for catching it, "record stop" needs to call real btrace_disable before unpushing the target. > In a gdbserver --multi session, I would expect that we're leaking the mmapped trace > buffer also on re-run. During re-run the first process gets killed first, so btrace_clear on the GDB side is appropriate in such case. On the gdbserver side there is linux_disable_btrace still called: #0 linux_disable_btrace (tinfo=0x66fd40) at ../common/linux-btrace.c:509 #1 in remove_thread (thread=0x66f900) at inferiors.c:165 #2 in delete_lwp (lwp=0x66f7d0) at linux-low.c:334 #3 in delete_lwp_callback (entry=0x66f7d0, proc=0x66f660) at linux-low.c:1234 #4 in find_inferior (list=0x666540 , func=0x425c61 , arg=0x66f660) at inferiors.c:185 #5 in linux_mourn (process=0x66f660) at linux-low.c:1248 #6 in linux_kill (pid=28282) at linux-low.c:1058 #7 in kill_inferior (pid=28282) at target.c:190 #8 in handle_v_kill (own_buf=0x667370 "vKill;6e7a") at server.c:2273 #9 in handle_v_requests (own_buf=0x667370 "vKill;6e7a", packet_len=10, new_packet_len=0x7fffffffd7c8) at server.c:2345 #10 in process_serial_event () at server.c:3484 So I find that OK. > I think this can be handled with an appropriate to_create_inferior method. I do not see a reason for that hook - could you be more specific? Thanks, Jan