[issue38009] Handle weakreference callbacks invoked indirectly in the middle of a gc collection

2019-09-27 Thread Neil Schemenauer
Neil Schemenauer added the comment: I think the problem with your logic is that the weakref to F is part of the garbage set. So, handle_finalizers() should detect that and clear the finalizer rather than call it. Once we get to delete_garbage() and start calling tp_clear(), we can't be run

[issue38009] Handle weakreference callbacks invoked indirectly in the middle of a gc collection

2019-09-02 Thread Christian Heimes
Change by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue38009] Handle weakreference callbacks invoked indirectly in the middle of a gc collection

2019-09-02 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue38009] Handle weakreference callbacks invoked indirectly in the middle of a gc collection

2019-09-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I think I am going to close this until we understand https://bugs.python.org/issue38006 better -- ___ Python tracker ___

[issue38009] Handle weakreference callbacks invoked indirectly in the middle of a gc collection

2019-09-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Check https://bugs.python.org/issue38006 for reference on this situation. I have the suspicion that something in this argument is wrong and the problem of arriving in this situation may be elsewhere, but I wanted to create this issue and show the prop

[issue38009] Handle weakreference callbacks invoked indirectly in the middle of a gc collection

2019-09-02 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +15310 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15645 ___ Python tracker __

[issue38009] Handle weakreference callbacks invoked indirectly in the middle of a gc collection

2019-09-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Antoine, could you check that I am not missing something in this logic? -- ___ Python tracker ___

[issue38009] Handle weakreference callbacks invoked indirectly in the middle of a gc collection

2019-09-02 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : A weak reference may try to invoke a callback object that is being cleaned (tp_clear) by the garbage collector and it may be in an inconsistent state. As the garbage collector explicitly does not invoke callbacks that are part of the same cycle isolate