[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Marc-Andre Lemburg
Hi Pablo, could you or Erlend please explain why types which don't reference any other objects need to participate in GC for deallocation ? Many PRs or checked in patches only do this: +static int +ucd_traverse(PreviousDBVersion *self, visitproc visit, void *arg) +{ +Py_VISIT(Py_TYPE(self));

[python-committers] Re: Commits are no longer noted in bro issues

2021-05-27 Thread Guido van Rossum
I think this seems fixed now? At least I've been getting emails about commits in main for bpo issues I'm following. On Tue, May 25, 2021 at 3:33 AM Victor Stinner wrote: > On Tue, May 18, 2021 at 12:33 AM Zachary Ware wrote: > > I might have found it; I at least opened > > https://github.com/ps

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Pablo Galindo Salgado
Hi Marc, Yes, check out this from the 3.9 what's new document: https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-c-api Instances of heap-allocated types (such as those created with PyType_FromSpec() and similar APIs) hold a reference to their type object since Python 3.8. As indicated i

[python-committers] Re: Commits are no longer noted in bro issues

2021-05-27 Thread Victor Stinner
I confirm that commits merged in 3.9, 3.10 and main branches are logged again in bugs.python.org. Thanks to everyone who helped to solve this issue! Victor -- Night gathers, and now my watch begins. It shall not end until my death. ___ python-committers

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Tim Peters
[Pablo Galindo Salgado ] > Hi Marc, > > Yes, check out this from the 3.9 what's new document: > > https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-c-api > > Instances of heap-allocated types (such as those created with > PyType_FromSpec() > and similar APIs) hold a reference to their typ

[python-committers] Re: Commits are no longer noted in bro issues

2021-05-27 Thread Irit Katriel via python-committers
I'm not getting anything at all from bpo for about a week now. Maybe it had enough of me. On Thu, May 27, 2021 at 6:01 PM Victor Stinner wrote: > I confirm that commits merged in 3.9, 3.10 and main branches are > logged again in bugs.python.org. Thanks to everyone who helped to > solve this issu

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Marc-Andre Lemburg
On 27.05.2021 19:40, Tim Peters wrote: > [Pablo Galindo Salgado ] >> Hi Marc, >> >> Yes, check out this from the 3.9 what's new document: >> >> https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-c-api >> >> Instances of heap-allocated types (such as those created with >> PyType_FromSpec()

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Tim Peters
[Tim Peters ] > ... > This is, I believe, akin to what Marc-Andre is bringing up: if X > can't be reached _from_ X's type object, there's no need for X's > tp_traverse to visit X's type object. It _can_ be visited, but it > would be a waste of time. Ya, I need to retract that :-) If X's type ob

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Pablo Galindo Salgado
> And if a type pointer is the only thing being visited, then there's no point unless the object can itself be reachable from the type object. But that could happen easily for heap types as they are mutable by default. For instance, you set the instance in a global: type -> module -> globals ->

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Tim Peters
[Tim] >> But I think "waste of time" is the worst of it. Participating in >> cyclic gc does nothing to delay refcounting from recycling objects >> ASAP. gc only reclaims objects that are reachable only from dead >> cycles; everything else in CPython is reclaimed the instant its >> refcount falls t

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Pablo Galindo Salgado
> So all those instances have an increase in memory footprint compared to Python 3.7 ? I am afraid that's the case. This is one of the costs of making types not being heap types. On Thu, 27 May 2021, 19:04 Marc-Andre Lemburg, wrote: > On 27.05.2021 19:40, Tim Peters wrote: > > [Pablo Galindo Sa

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Pablo Galindo Salgado
> "Why?" is baffling to me: how could they possibly participate in a cycle? If the type object is a heap type (by default mutable), someone could just add a reference directly to it that makes it being in a cycle with the instance. Even if that's not the case, IIRC, as the type refers to the modu

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Marc-Andre Lemburg
On 27.05.2021 20:20, Pablo Galindo Salgado wrote: >> And if a type pointer is the only thing being visited, then there's > no point unless the object can itself be reachable from the type object. > > But that could happen easily for heap types as they are mutable by default. > For > instance, you

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Pablo Galindo Salgado
> Modules dicts are cleared during interpreter shutdown to break such cycles. That is precisely what's not working because of the cycles, check the first message in the issue: https://bugs.python.org/msg385297 > Also: Why are types mutable ? AFAIK, they are only meant to be mutable at C level an

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Pablo Galindo Salgado
Sorry, the last link should have been: https://bugs.python.org/issue43908 On Thu, 27 May 2021 at 19:41, Pablo Galindo Salgado wrote: > > Modules dicts are cleared during interpreter shutdown to break > such cycles. > > That is precisely what's not working because of the cycles, check the > fir

[python-committers] Re: Commits are no longer noted in bro issues

2021-05-27 Thread Guido van Rossum
Did you check your junk or spam mail folders? The email address from which bpo is sending email is not super trusted by the spam filters used by large email providers like GMail and Outlook. On Thu, May 27, 2021 at 10:46 AM Irit Katriel wrote: > > I'm not getting anything at all from bpo for abo

[python-committers] Re: Commits are no longer noted in bro issues

2021-05-27 Thread Berker Peksağ
On Thu, May 27, 2021 at 8:46 PM Irit Katriel via python-committers wrote: > > > I'm not getting anything at all from bpo for about a week now. Maybe it had > enough of me. That has nothing to do with the BPO issue we have been talking about. The infra team is the best place to report email deliv

[python-committers] Re: Commits are no longer noted in bro issues

2021-05-27 Thread Berker Peksağ
On Thu, May 27, 2021 at 9:50 PM Guido van Rossum wrote: > > Did you check your junk or spam mail folders? The email address from which > bpo is sending email is not super trusted by the spam filters used by large > email providers like GMail and Outlook. Unfortunately, this is not just the case

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Tim Peters
[Tim] >> And if a type pointer is the only thing being visited, then there's no point >> unless the object can itself be reachable from the type object. {Pablo] > But that could happen easily for heap types as they are mutable by > default. For instance, you set the instance in a global: > > type

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Pablo Galindo Salgado
> Can you flesh this out for what stumbled into being my running example? That is, how could a regexp pattern object be part of a cycle? Let me try to remember when we saw this problem in the past, but on first sigh, it seems that indeed that cannot happen in the regular case. > And, in general,

[python-committers] Re: Commits are no longer noted in bro issues

2021-05-27 Thread Irit Katriel via python-committers
My spam folder contains solutions to most of life's problems, but nothing about python. I'll check with the infra team, thanks. On Thu, May 27, 2021 at 8:11 PM Berker Peksağ wrote: > On Thu, May 27, 2021 at 9:50 PM Guido van Rossum wrote: > > > > Did you check your junk or spam mail folders? Th

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Pablo Galindo Salgado
[Tim] > Can you flesh this out for what stumbled into being my running example? That is, how could a regexp pattern object be part of a cycle? Found the problem that we saw regarding a cycle involving the type. That comes from this comment: https://github.com/python/cpython/pull/23811#issuecommen

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Victor Stinner
On Thu, May 27, 2021 at 8:24 PM Pablo Galindo Salgado wrote: > > And if a type pointer is the only thing being visited, then there's no > > point unless the object can itself be reachable from the type object. > > But that could happen easily for heap types as they are mutable by default. > For

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Pablo Galindo Salgado
Tim, check this out: >>> import re, gc >>> x = re.compile("x") >>> gc.get_referents(x.__class__)[-1] That seems due to: https://github.com/python/cpython/blob/e90e0422182f4ca7faefd19c629f84aebb34e2ee/Objects/typeobject.c#L4241 On Thu, 27 May 2021 at 20:15, Tim Peters wrote: > [Tim] > >> And

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Tim Peters
;Victor Stinner ] > ... > For a more concrete example, read the "_thread lock traverse" section > of my article on these problems: > https://vstinner.github.io/subinterpreter-leaks.html > > There were two reference cycles, and both were "connected" with a lock > object in the middle (look at my dra

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Pablo Galindo Salgado
> So, on what principled basis do we exempt, say, ints from participating in cyclic GC too? Do we have to "just know" that a cycle can't be reached from an int's type object? If so, is that even true? Or just convenient to pretend to believe to avoid adding 16 more bytes to each int object and gros

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Tim Peters
{Tim] > So, on what principled basis do we exempt, say, ints from > participating in cyclic GC too? {Pablo] > In this case, the int object doesn't have a reference to its type because is > not a heap type > so that's fine. That baffled me at first, because _every_ object contains a pointer to it

[python-committers] Re: IMPORTANT: Python 3.10b2 release blockers

2021-05-27 Thread Tim Peters
[Pablo] > Tim, check this out: > > >>> import re, gc > >>> x = re.compile("x") > >>> gc.get_referents(x.__class__)[-1] > Cool! So presumably this constructs a cycle involving a pattern object: import re p = re.compile("ab*c") import _sre _sre.WOWZA = p Indeed, under the current main branch: >>