Skip to content
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

Closed
y-fujisaki2 opened this issue Sep 14, 2017 · 3 comments
Closed

Fix process of reference count during GC #66

y-fujisaki2 opened this issue Sep 14, 2017 · 3 comments

Comments

@y-fujisaki2
Copy link

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

jamadden added a commit that referenced this issue Sep 15, 2017
Fix possibility of rare crash during dealloc. Fixes #66
@y-fujisaki2
Copy link
Author

Thanks so much for marging this fix.

@jamadden
Copy link
Member

@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?

@y-fujisaki2
Copy link
Author

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.

clrpackages pushed a commit to clearlinux-pkgs/persistent that referenced this issue Jul 31, 2018
… #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>`_.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants