Re: [Zope-dev] Leak in 2.5.1 cAccessControl.c !?

2002-07-19 Thread Stefan H. Holek

Could be. ;-)

Does your problem go away when you put
export ZOPE_SECURITY_POLICY=PYTHON
in your start script?

Mine did. I would otherwise not have suspected cAccessControl.

Stefan


--On Donnerstag, 18. Juli 2002 13:28 -0700 Charlie Reiman 
<[EMAIL PROTECTED]> wrote:

> Could this be related to the collector issue I already filed?
>
> http://collector.zope.org/Zope/421
>

--
Those who write software only for pay should go hurt some other field.
/Erik Naggum/


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Leak in 2.5.1 cAccessControl.c !?

2002-07-18 Thread Stefan H. Holek

Hi All!

I believe I have found a leak in cAccessControl.c of Zope 2.5.1. See the 
patch below. It was difficult to spot because in the respective section of 
cAccessControl.c the 'owner' variable is reused several times. Note that 
'ASSIGN' decrefs 'owner' before actually assigning, whereas the original 
line doesn't and thus leaks a ref (I think).

I was hunting for leaked ImplicitAcquirerWrappers and was able to track 
them down to Owned.getOwner() which returns wrapped User objects 
(LeakFinder rocks!). The patch appears to stop the wrappers from leaking.

However, I am still leaking Users so I am not sure whether I have really 
and completely nailed it. From what I have seen in Acquisition.c decref'ing 
a wrapper also decrefs the wrappee. Assuming that no special handling of 
wrapped vs. unwrapped objects is required (with regards to decref'ing) what 
I observe may well be unrelated.

What do you think? If somebody can confirm this I will put it in the 
Collector.

Thanks,
Stefan


--- cAccessControl.cFri Apr 12 17:18:44 2002
+++ cAccessControl.cThu Jul 18 13:22:48 2002
@@ -1028,7 +1028,7 @@
   }

if (owner != Py_None) {
-  owner = PyObject_GetAttr(owner, allowed_str);
+  ASSIGN(owner, PyObject_GetAttr(owner, allowed_str));
   if (owner)
 ASSIGN(owner, callfunction2(owner, value, roles));
   if (owner == NULL)

--
Those who write software only for pay should go hurt some other field.
/Erik Naggum/


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )