From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 27iDBdqQGGp+BSUAWB0awg (envelope-from ) for ; Thu, 28 May 2026 15:00:42 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=TUCaxMPH; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 00ED31E024; Thu, 28 May 2026 15:00:41 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 360E81E024 for ; Thu, 28 May 2026 15:00:40 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AA4A44BA2E2A for ; Thu, 28 May 2026 19:00:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA4A44BA2E2A Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=TUCaxMPH Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id 41D564BA2E18 for ; Thu, 28 May 2026 19:00:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 41D564BA2E18 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 41D564BA2E18 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779994812; cv=none; b=ljwVIYZko+GovuI246ZwQrjM+YP9OwHk4uu816h2JHDD2DaS2h6dgKQiGUoeUjaBTy/omiuwzYUPE2XlgFv/VVj1sxnrQQWA18OGa3eGAbgW/J/dLN3qvh0Ge+vtE4MRXIC5BI/4BtwIfMDt13Msm1NJcLHs2bhgcXuVXiYIzCo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779994812; c=relaxed/simple; bh=Ju6qB/F7KXp8d6hUVb9ZONA9jiUFDau2y9+D46N23Ew=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=aqin4IjmxQZCSJvtOG8h49QwHGOxPos2rTUF46vHlbHcWO6//epkqhDVYIcgll5UdBR3OCZ5pKSG3C8RyvGRk11mJbFOlhvFP3OACqBxxkka66XAvjAnx0O65Vx2GizgCasc1NjjBbNdClSf6kHcn5h0puLH2JTW17ITayOugY0= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=TUCaxMPH reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 41D564BA2E18 Received: from eig-obgw-5003b.ext.cloudfilter.net ([10.0.29.155]) by cmsmtp with ESMTPS id SesPwnvmNlPo5SfxjwTtkt; Thu, 28 May 2026 19:00:11 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id SfxgwxFPRkh2OSfxgw7zZu; Thu, 28 May 2026 19:00:08 +0000 X-Authority-Analysis: v=2.4 cv=YpgPR5YX c=1 sm=1 tr=0 ts=6a1890ba a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=NGcC8JguVDcA:10 a=ItBw4LHWJt0A:10 a=7CQSdrXTAAAA:8 a=2hsVxaTgfrJHyHGX6UcA:9 a=a-qgeE7W1pNrGK8U0ZQC:22 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=rJSgZy9NGI/OL11MruHieZQ0mtEHaNbBgHBmRjaTaEc=; b=TUCaxMPHsVOaegpp6fpPKC01/o Vl0DpWcC6hW05ZK3Lw/A5xfWo7twx+A61u6VI/rJR+A/KB3oPl8HGxT+As4ZbKQyIAIMSaoRf2bBd NFIWCBq1EilT2MryKemQyMnZc; Received: from 75-166-225-82.hlrn.qwest.net ([75.166.225.82]:38448 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.2) (envelope-from ) id 1wSfxf-00000001auV-3nSC; Thu, 28 May 2026 13:00:07 -0600 From: Tom Tromey To: Matthieu Longo Cc: Tom Tromey , gdb-patches@sourceware.org, Andrew Burgess Subject: Re: [PATCH v1] gdb/python: fix memory leak in gdb_py_tp_name In-Reply-To: <62841b2c-9d0e-4efc-9b26-ca9bfd8787b9@arm.com> (Matthieu Longo's message of "Thu, 28 May 2026 18:08:27 +0100") References: <20260526160459.270322-1-matthieu.longo@arm.com> <87fr3e6sdp.fsf@tromey.com> <11b35b46-7e18-471a-94e2-91fef5b287d2@arm.com> <87tsrr5vtl.fsf@tromey.com> <62841b2c-9d0e-4efc-9b26-ca9bfd8787b9@arm.com> X-Attribution: Tom Date: Thu, 28 May 2026 13:00:02 -0600 Message-ID: <87ldd35php.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.225.82 X-Source-L: No X-Exim-ID: 1wSfxf-00000001auV-3nSC X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-225-82.hlrn.qwest.net (bapiya) [75.166.225.82]:38448 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfETWWbAHbyGI6A3wNqnimvuZ7mMLtcoJPCIO9hFHJd1OL0PicWBDWA8pz6JW2cQRBU7/GypqO4KV5bgMFdM/vYHJtO96iL6k+KCmTfLcmw1q3ZtByD58 A/TsNp8T5VI6eVWURHbsWL/gE3Dcv40Ov+qYhzfnmTrqjnXQcY1liboAEZR0TPl9NAsZH2gJtpFlLs8hHjRQGzzhk6zhR0dhwMY= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >>>>> "Matthieu" == Matthieu Longo writes: Matthieu> Indeed that can happen, for instance, when this function is called Matthieu> inside a tp_clear() in the middle of a PyObject destruction. Thanks. Matthieu> Something like below would at least avoid the general abort, but it Matthieu> would cause logging of errors in the middle of the destruction. How Matthieu> useful would it be ? Matthieu> gdbpy_ref<> fully_qualified_name (PyType_GetFullyQualifiedName (py_type)); Matthieu> if (fully_qualified_name == nullptr) Matthieu> { Matthieu> PyErr_Print(); Matthieu> PyErr_Clear(); Matthieu> return {}; Matthieu> } Matthieu> At this point, I don't think that it is super important not to crash Matthieu> because there is a serious logic error somewhere if we are unable to Matthieu> get this name. Consequently, an assert might be more appropriate. If we think it could conceivably happen then it should probably just call gdbpy_print_stack (which is basically the above but with some user controls) and then return some error string. Tom