I've applied both patches, however I've changed the incref part a
little. Now it reads:
#define Py_INCREF(op) ((op)->ob_refcnt > 0 ? (op)->ob_refcnt++ :
fprintf(stderr,"Eeek! Increfing an object from refct 0 at
It's all in one line if my MUA wrapped it. I did it so as to make sure
it doesn't crash in different places than it crashed before.
I'll report anything I find
On Thu, 2002-03-14 at 19:44, Matthew T. Kromer wrote:
> Matthew T. Kromer wrote:
> > Attached is another diagnostic patch which you might apply to Python.
> > If you apply this patch, you WILL need to rebuild Zope to include it.
> > What it will do is complain to stderr if an object is INCREF'd from
> > refcount 0. It also silences the complaint for the one area which I
> > know revives dead objects.
> > This patch will probably cause a crash after an erroneous
> > incref-from-0 is detected, since it doesnt actually DO the incref in
> > that case.
> > The intent is to find a case in the code where an object is held
> > between threads; one thread decrefs to zero, the other thread increfs,
> > causing a revive -- but too late to save the patient.
> extensionclass also brings back the dead; the following patch to Zope's
> extensionclass will turn off the warning when it happens when you apply
> the previous patch that I sent out that complains when an object is
> incref'd from a refcount of zero.
> Matt Kromer
> Zope Corporation http://www.zope.com/
> Index: lib/Components/ExtensionClass/src/ExtensionClass.c
> RCS file: /cvs-repository/Zope/lib/Components/ExtensionClass/src/ExtensionClass.c,v
> retrieving revision 188.8.131.52
> diff -u -r184.108.40.206 ExtensionClass.c
> --- lib/Components/ExtensionClass/src/ExtensionClass.c 4 Oct 2001 14:25:19
> +++ lib/Components/ExtensionClass/src/ExtensionClass.c 14 Mar 2002 22:43:10
> @@ -3047,8 +3047,9 @@
> fprintf(stderr,"Deallocating a %s\n", self->ob_type->tp_name);
> + self->ob_refcnt++;
> - Py_INCREF(self); /* Give us a new lease on life */
> + /* Py_INCREF(self); /* Give us a new lease on life */
> if (subclass_watcher &&
> ! PyObject_CallMethod(subclass_watcher,"destroying","O",self))
Ideas don't stay in some minds very long because they don't like
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -