From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27327 invoked by alias); 7 May 2019 11:26:47 -0000 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 Received: (qmail 27284 invoked by uid 89); 7 May 2019 11:26:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=H*r:user, robust X-HELO: relay.fit.cvut.cz Received: from relay.fit.cvut.cz (HELO relay.fit.cvut.cz) (147.32.232.237) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 May 2019 11:26:44 +0000 Received: from imap.fit.cvut.cz (imap.fit.cvut.cz [147.32.232.238]) by relay.fit.cvut.cz (8.15.2/8.15.2) with ESMTPS id x47BQdP6009156 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 May 2019 13:26:41 +0200 (CEST) (envelope-from jan.vrany@fit.cvut.cz) Received: from sao (02791bac.bb.sky.com [2.121.27.172] (may be forged)) (authenticated bits=0 as user vranyj1) by imap.fit.cvut.cz (8.15.2/8.15.2) with ESMTPSA id x47BPatE022999 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 7 May 2019 13:26:39 +0200 (CEST) (envelope-from jan.vrany@fit.cvut.cz) Message-ID: <31326cf9e4f843bef7141860306b20ee016b06bf.camel@fit.cvut.cz> Subject: Re: [RFC 8/8] mi/python: Allow redefinition of python MI commands From: Jan Vrany To: Tom Tromey Cc: gdb-patches Date: Tue, 07 May 2019 11:26:00 -0000 In-Reply-To: <87woj3mfbs.fsf@tromey.com> References: <20190418152337.6376-1-jan.vrany@fit.cvut.cz> <20190418152337.6376-9-jan.vrany@fit.cvut.cz> <87h8al7tke.fsf@tromey.com> <87woj3mfbs.fsf@tromey.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-05/txt/msg00184.txt.bz2 On Mon, 2019-05-06 at 15:40 -0600, Tom Tromey wrote: > Jan> Does above address your concern? > > The issue isn't a leak but rather the possibility of using an object > after it's been destroyed. > > That is, if an MI command can be running when it is replaced, the code > has to be sure that the command object isn't referenced after the > replacement -- because the old object will have been destroyed. > I see. I just added a test for this case into "almost finished" v2 of the patch series. There, this problem is kind of avoided by making sure that in mi_command_py::invoke anything from "this" mi_command_py object is not accessed AFTER calling the python code. However I agree that using shared_ptr is more robust solution. Thanks! Jan > Tom