From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18365 invoked by alias); 4 Jun 2014 20:21:08 -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 18355 invoked by uid 89); 4 Jun 2014 20:21:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Jun 2014 20:21:01 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s54KKwNK032483 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Jun 2014 16:20:59 -0400 Received: from barimba ([10.3.113.4]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s54KKvjl003244 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Wed, 4 Jun 2014 16:20:58 -0400 From: Tom Tromey To: Yao Qi Cc: Subject: Re: [PATCH 02/12] Generalize varobj iterator References: <1392367471-13527-1-git-send-email-yao@codesourcery.com> <1392367471-13527-3-git-send-email-yao@codesourcery.com> <874n0jkokw.fsf@fleche.redhat.com> <537EA293.2050000@codesourcery.com> Date: Wed, 04 Jun 2014 20:21:00 -0000 In-Reply-To: <537EA293.2050000@codesourcery.com> (Yao Qi's message of "Fri, 23 May 2014 09:21:23 +0800") Message-ID: <87k38wa0k6.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-06/txt/msg00215.txt.bz2 >>>>> "Yao" == Yao Qi writes: Yao> On 05/22/2014 01:51 AM, Tom Tromey wrote: Yao> +static void Yao> +py_varobj_iter_dtor (struct varobj_iter *self) Yao> +{ Yao> + struct py_varobj_iter *dis = (struct py_varobj_iter *) self; Yao> + Yao> + Py_XDECREF (dis->iter); Tom> I think this has to acquire the GIL before calling Py_XDECREF. Yao> PyGILState_Ensure and PyGILState_Release are added. I think all transitions from gdb->python should use ensure_python_env. That way the other things needed by gdb's python layer are guaranteed to be set. In this situation I think it could potentially cause a problem if Py_XDECREF calls a user-written __del__ method somewhere. thanks, Tom