-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix process of reference count during GC #66
Comments
Fix possibility of rare crash during dealloc. Fixes #66
Thanks so much for marging this fix. |
@y-fujisaki2 I am curious: you have posted bug reports about this issue to many repositories that I follow. I saw the original Python big report. What made you file all of these other big reports, like this one here, especially against such old versions? Have you experienced any crashes? |
Thank you for your follows. Using Python 2.7, we got a core file. So we investigated to confirm whether there weren't other problems which are the same state at all zope and python sources. |
… #66 Charles Merriam (1): Update documentation links. Jason Madden (7): Back to development: 4.2.5 Merge pull request #67 from zopefoundation/issue66 Change cPickleCache to use PER_TypeCheck Merge pull request #70 from zopefoundation/issue69 Update url in setup.py Merge pull request #72 from zopefoundation/issue71 Preparing release 4.3.0 Jim Fulton (1): Merge pull request #68 from merriam/merriam-patch-1 KIMURA Chikahiro (1): Fix possibility of rare crash during dealloc. Fixes #66 Marius Gedminas (1): Use SVG icon for Travis Michael Howitz (1): No longer use shut down API. 4.3.0 (2018-07-30) ------------------ - Fix the possibility of a rare crash in the C extension when deallocating items. See zopefoundation/persistent#66 - Change cPickleCache's comparison of object sizes to determine whether an object can go in the cache to use ``PyObject_TypeCheck()``. This matches what the pure Python implementation does and is a stronger test that the object really is compatible with the cache. Previously, an object could potentially include ``cPersistent_HEAD`` and *not* set ``tp_base`` to ``cPersistenceCAPI->pertype`` and still be eligible for the pickle cache; that is no longer the case. See `issue 69 <https://github.com/zopefoundation/persistent/issues/69>`_.
When we subtract reference counter of an object, the destructor is automatically called if the value of counter is 0.
At the same time an error occurs, as the GC executed while the destructor is still in running phase.
To eliminate the error, we have added below program which exclude objects from GC in the destructor in line 4.
static void
Wrapper_dealloc(Wrapper *self)
{
PyObject_GC_UnTrack((PyObject )self); //Add this line to eliminate self from GC
Wrapper_clear(self);
self->ob_type->tp_free((PyObject)self);
}
Patch: ZODB3-3.10.7.zip
The text was updated successfully, but these errors were encountered: