From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wVquLCYyqGprjAwAWB0awg (envelope-from ) for ; Mon, 14 Sep 2026 13:43:02 -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=a5EbYKv8; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B3A071E01F; Mon, 14 Sep 2026 13:43:02 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 2B0421E01F for ; Mon, 14 Sep 2026 13:43:02 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 565044B99F7E for ; Mon, 14 Sep 2026 17:42:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 565044B99F7E 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=a5EbYKv8 Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id 0BC3A4B99F60 for ; Mon, 14 Sep 2026 17:42:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0BC3A4B99F60 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 0BC3A4B99F60 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789407749; cv=none; b=QCaQKli1ejiSUSRBi+r9zyHul7IP70w+6DGwBbPqVwtKFBBOUPwKsSBC0BCRoslTH8rOHL0s2ARTpbilJu8eBR0EVMDQw1l9FAdw3Bub/P2YrDz/iGgWA2MYNuSGPekL6ABZ7oAn2xnVX1RReNIJiVaUPCQZKNwuj6hUpXYttRE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789407749; c=relaxed/simple; bh=Pxzzgl9vomiXsR4ALGoBU0NJ6CXU8w4/F78XKspJY+M=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Qlp1KPRREp5XnGiFOZuNup8KyMQuSijhFtwhixOKU9GoWqxhrOri+JryQzd94JnIc1zE18U3bn6xW7PLlRA9XIylKVgaEF+yPRnJYLEvZvR88Zf5KfWZi7vgx3R5Mf4qcWa/6ynEdHKsoVOmJgABmTd54Git868AH8QdK/Ayjxk= 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=a5EbYKv8 reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BC3A4B99F60 Received: from eig-obgw-6007b.ext.cloudfilter.net ([10.0.30.166]) by cmsmtp with ESMTPS id 67TqxtziFusRS6AhHxKbft; Mon, 14 Sep 2026 17:42:27 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 6AhHxi9OmF2DA6AhHxbwhV; Mon, 14 Sep 2026 17:42:27 +0000 X-Authority-Analysis: v=2.4 cv=FaM3xI+6 c=1 sm=1 tr=0 ts=6aa83203 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=ItBw4LHWJt0A:10 a=F6cm_-uwefKAKIk8eT8A:9 a=QEXdDO2ut3YA:10 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=DGtnlTJr/yvp0HPy8gzIp+NtgbF43fpOooMayTl8k6U=; b=a5EbYKv89YES9fQA8ploAZSW2f Xq8QlWr2yWLM+GauCpwR+kjxJDLae/9OpDRGBd1621tABGZJ1jiedYp5bOclJqddxQoMOXDZ0Ji9J uJ11EoROwDbwG+VFyNtld1kD4; Received: from 75-166-229-74.hlrn.qwest.net ([75.166.229.74]:40014 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.100) (envelope-from ) id 1x6AhG-000000030aI-3bDR; Mon, 14 Sep 2026 11:42:26 -0600 From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 1/4] Change evpy_emit_event to accept a gdbpy_opt_borrowed_ref In-Reply-To: <8c6dadb8-d305-4df8-b5ac-42c15a34b734@simark.ca> (Simon Marchi's message of "Mon, 14 Sep 2026 11:42:47 -0400") References: <20260808-python-safety-events-simple-v1-0-132aea40c801@tromey.com> <20260808-python-safety-events-simple-v1-1-132aea40c801@tromey.com> <8c6dadb8-d305-4df8-b5ac-42c15a34b734@simark.ca> X-Attribution: Tom Date: Mon, 14 Sep 2026 11:42:25 -0600 Message-ID: <87qzivwwzi.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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.229.74 X-Source-L: No X-Exim-ID: 1x6AhG-000000030aI-3bDR X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-229-74.hlrn.qwest.net (bapiya) [75.166.229.74]:40014 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: MS4xfOv5hGiRbNQxAfEz7QIKCmKXJSDcQt07U9HD+KXdGe/SJ531+VPJLwXylsYxJDwf6nBrWPkqV76txvcA9HL223crnY0ZjiC8ODxR+E1FE7fol+YInqDR gd0f8sy5cg98d7UvHW0lbfQUzS6371UCMArOPIuTfTWCCjtOaRCoh+6FMn3nua2z/UeTLd20hVWuUNx1VWfHCGzH2JEztqdOFac= 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 Simon> Copying a review comment from Claude that seems important: Simon> - gdb/python/py-event.c:88: PyObject_CallFunctionObjArgs (func, ev= ent, Simon> NULL) =E2=80=94 event is now a gdbpy_opt_borrowed_ref<> and sits= in the ... FWIW I looked at all other calls to PyObject_CallFunctionObjArgs and they are currently safe. When moving this code more fully to the "safety" API, I think we can replace this varargs call with a template function that knows how to turn arguments into 'PyObject *', making it more safe. Arguably maybe gdbpy_opt_borrowed_ref should only be accepted as the final argument since a null value terminates the arguments. Or maybe we should replace this with a check at the caller; which is slightly less efficient but also maybe more clear. Tom