From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22394 invoked by alias); 7 Mar 2013 15:22:19 -0000 Received: (qmail 22382 invoked by uid 22791); 7 Mar 2013 15:22:18 -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 15:22:04 +0000 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 07 Mar 2013 07:22:02 -0800 X-ExtLoop1: 1 Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by AZSMGA002.ch.intel.com with ESMTP; 07 Mar 2013 07:22:01 -0800 Received: from irsmsx151.ger.corp.intel.com (163.33.192.59) by IRSMSX101.ger.corp.intel.com (163.33.3.153) with Microsoft SMTP Server (TLS) id 14.1.355.2; Thu, 7 Mar 2013 15:21:59 +0000 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.244]) by IRSMSX151.ger.corp.intel.com ([169.254.4.245]) with mapi id 14.01.0355.002; Thu, 7 Mar 2013 15:21:58 +0000 From: "Metzger, Markus T" To: Jan Kratochvil CC: "gdb-patches@sourceware.org" , "markus.t.metzger@gmail.com" , "Himpel, Christian" , Pedro Alves Subject: RE: Crash of GDB with gdbserver btrace enabled [Re: [patch v9 00/23] branch tracing support for Atom] Date: Thu, 07 Mar 2013 15:22:00 -0000 Message-ID: References: <20130306170622.GA25771@host2.jankratochvil.net> <20130307090632.GA11095@host2.jankratochvil.net> <20130307101350.GA14969@host2.jankratochvil.net> <20130307120644.GA21253@host2.jankratochvil.net> <20130307144440.GA477@host2.jankratochvil.net> In-Reply-To: <20130307144440.GA477@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/msg00295.txt.bz2 > -----Original Message----- > From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] > Sent: Thursday, March 07, 2013 3:45 PM Thanks for bearing with me on this. [..] > > We also must not clear btrace in to_close since this would prevent btra= ce > > 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. >=20 > to_close can be called in controlled (such as "record stop") or uncontrol= led > (inferior dies / gets killed). In the first case "record stop" should > explicitly disable the tracing before calling to_close. In the second ca= se it > does not matter when the tracing disable happens, it just needs to happen. >=20 > For the second case there must be always someone who does the munmap + cl= ose. > In the linux-nat case it can be easily done from btrace's to_close. In t= he > gdbserver case it is gdbserver's responsibility (where it actually already > works). I assume you mean from a new target to_teardown_btrace method and not from btrace's to_close. That's where it currently is and where we want it = moved away from. To summarize: 1. add a new target method to_teardown_btrace 1.1. disable btrace for native targets 1.2. only clear the trace and free the btrace_target_info for remote targets 2. call target_teardown_btrace from clear_thread_inferior_resources 3. add new target method to_stop_recording 3.1. disable btrace in record-btrace target 3.2. undefined in other record targets - may later split record-full's to_c= lose. 4. call target_stop_recording in "record stop" before unpushing the record = target 5. call target_stop_recording in record_mourn_inferior before unpushing the= record target 6. call target_stop_recording in record_detach before unpushing the record = target 7. call target_stop_recording in record_disconnect before unpushing the rec= ord target 8. call target_stop_recording in record_kill before unpushing the record ta= rget 9. remove btrace disable from record_btrace_to_close This will make record_btrace_to_close empty. I must not touch the per-thre= ad btrace configuration since this is needed later in 2. I'll make this a separate patch for easier review. I can later split it and= merge the pieces into the respective btrace patches. 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