From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EKENGsZwGGrWBSMAWB0awg (envelope-from ) for ; Thu, 28 May 2026 12:43:50 -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=uKV+hwY1; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 571131E0A3; Thu, 28 May 2026 12:43:50 -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 B4E941E062 for ; Thu, 28 May 2026 12:43:49 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3CD364BA23C7 for ; Thu, 28 May 2026 16:43:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3CD364BA23C7 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=uKV+hwY1 Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id E3F154BA2E04 for ; Thu, 28 May 2026 16:43:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E3F154BA2E04 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 E3F154BA2E04 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=1779986602; cv=none; b=REPjvjAuMy4SAxF6bzN1xPx0F8lRuu9+UeKWBFXvRxx5lP/21++mKaX6fhx0dtkd+I+tk7qQJqyVpeabOTxluksNWY/JItDMEt3oTlrw0e9NKloPHJAfopr+bhPLFjcaCH5xC/ywkLhYIwfjn/Pfgl1kXnvh3k2d2Odl5P2LcdU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779986602; c=relaxed/simple; bh=O8Xy/A12ZYaFO24sLsWFcFUztqSjELeiC9vmxyeYELA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=HchRkuUgin+uumn5uQmk9rYNTCLWPUFfkDcZeST0xc48uDCndmFR4g+eoMQQYt/u7JCi55d1LI08H2XZup0HAPgNmnRrgr5hxekbRAhHkZhaxazMAHDbXZuRD60T1J26RfALDVj8fp+g7gi53+YVqj3KZYHo+dEOCia68VPzBPs= 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=uKV+hwY1 reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3F154BA2E04 Received: from eig-obgw-5005b.ext.cloudfilter.net ([10.0.29.189]) by cmsmtp with ESMTPS id SbVBwn1CglPo5SdpIwSUj5; Thu, 28 May 2026 16:43:21 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id SdpIw4TMqDvkeSdpIwI9ZN; Thu, 28 May 2026 16:43:20 +0000 X-Authority-Analysis: v=2.4 cv=RaOQC0tv c=1 sm=1 tr=0 ts=6a1870a8 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=NGcC8JguVDcA:10 a=ItBw4LHWJt0A:10 a=7CQSdrXTAAAA:8 a=bd7ZjJG-D09sGz3HeSsA: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=Zv2C37sYpt4a7mjn+Tzg2iMosXvoUjxmbjOrzuFoXzo=; b=uKV+hwY12NyKCLBV2YAfr8/IRu +B8Y6cdrnFCuyCGAJrO843wxjt3SjWSkI5FqtkqpjTYEKDvBg+hnVtBssQ/0tg1Y2qIlmwM/8wf3I s6W0cg8lFKnWw90UOy2DoIfg4; Received: from 75-166-225-82.hlrn.qwest.net ([75.166.225.82]:38688 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.2) (envelope-from ) id 1wSdpH-00000003lM0-30HR; Thu, 28 May 2026 10:43:19 -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: <11b35b46-7e18-471a-94e2-91fef5b287d2@arm.com> (Matthieu Longo's message of "Thu, 28 May 2026 13:46:43 +0100") References: <20260526160459.270322-1-matthieu.longo@arm.com> <87fr3e6sdp.fsf@tromey.com> <11b35b46-7e18-471a-94e2-91fef5b287d2@arm.com> X-Attribution: Tom Date: Thu, 28 May 2026 10:43:18 -0600 Message-ID: <87tsrr5vtl.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: 1wSdpH-00000003lM0-30HR X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-225-82.hlrn.qwest.net (bapiya) [75.166.225.82]:38688 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfKaLizk9M0kCkMtKSMz+TKPls+WDPyuDoynlSdaV+s+xq4ULkLw7wJqN5+VOnPuUzQeT7bavBWP5muE9BAZe27yKpD5z7LVrBRSaQoPF9klFJk5kKPPY Kjo+ErEZb3OzItL2Ub2fyhvkZdOuJbnGonjoTD2j6DDj8DdZjvifuyM5Zb7yt1L+1YrPrR+TWlwaDCF4NKQciCJGtZfggYwdHZE= 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 Longo writes: > Sorry, I completely missed those issues while I was changing the code > in others places. I should definitely have spotted them if it was not > my thoughtlessness in those last days. Don't beat yourself up, it's all just normal stuff. > - PyObject *fully_qualified_name = PyType_GetFullyQualifiedName (py_type); > + gdbpy_ref<> fully_qualified_name (PyType_GetFullyQualifiedName (py_type)); > if (fully_qualified_name == nullptr) > - return nullptr; > + return {}; Something I missed in the initial patch to add gdb_py_tp_name is that if it fails, then the exception will be set, and the callers don't seem to be prepared to handle that. I'm not really sure what to do about it. I guess the principled thing would be to change the callers (including those of gdbpy_py_obj_tp_name) to handle this properly :( Though if we're really sure that this can only fail pathologically somehow, I suppose we could add asserts in gdb_py_tp_name itself. Tom