[Tim] > ... > The suggested approach in the long earlier email should repair both > the segfault and the AttributeError-out-of-thin-air surprises. ... > The specific invocation of gc in which this occurred wouldn't be able > to collect anything (at all, even if there were a million other objects > in vanilla trash cycles at the time -- they wouldn't get collected > until a later run of gc, one that didn't resurrect dead cycles). Sorry, not so -- the "mini gc pass" of the same gc invocation would collect all million of the other objects in vanilla trash cycles. It's only weakref callbacks sick enough to install brand new weakref callbacks on dead objects that would prevent the other trash from getting collected in the same gc invocation. There wasn't anything like that in the segfaulting program. It's also possible that we could change the weakref implementation to refuse to allow creating new weakrefs while a weakref callback was in progress. But that would be a new restriction; it wouldn't save gc much work (the mini gc pass would still have to do full live-dead analysis on the leftover trash; it would only save that pass from asking the "survivors" whether they grew any new weakref callbacks); and reporting an exception that occurs during gc happens by calling Py_FatalError (it's extreme).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4