[Python-Dev] Re: Object deallocation during the finalization of Python program

2020-01-11 Thread Pau Freixes
HI, Thanks for the comments, really interesting use case this one [1], I've just read it in diagonal but seems that is similar to the bug that finally I've found in our program. Basically GC was clearing all of the attributes before the deallocation for unbreaking an indirect reference cycle whic

[Python-Dev] Re: Object deallocation during the finalization of Python program

2020-01-11 Thread Armin Rigo
Hi Pau, Also, the Cython documentation warns against doing this kind of things (here, accessing the Python object stored in ``foo``). From https://cython.readthedocs.io/en/latest/src/userguide/special_methods.html: You need to be careful what you do in a __dealloc__() method. By the time

[Python-Dev] Re: Object deallocation during the finalization of Python program

2020-01-09 Thread Tim Peters
[Pau Freixes ] > Recently I've been facing a really weird bug where a Python program > was randomly segfaulting during the finalization, the program was > using some C extensions via Cython. There's nothing general that can be said that would help. These things require excruciating details to res