[PEAK] Memleak in PEAK with Python 2.3.5 with ldap-module installed ?

Ulrich Eck ueck at net-labs.de
Thu Apr 14 05:14:14 EDT 2005


Hi Phillip,

this happens to be a problem with the change to LDAP that you fixed (on
my request) recently:

the testCursor returns "RES_SEARCH_RESULT" in
peak/storage/tests/LDAP.py:
-----------------------------------------
class TestCursor(LDAPCursor):

    msgid = 9999

    fooCvt = binding.Make(
        lambda: fooCvt, offerAs=['peak.ldap.field_converters.foo']
    )

    barCvt = binding.Make(
        lambda: barCvt, offerAs = ['peak.ldap.field_converters.bar']
    )

    class _conn(object):

        def result(msgid, getall, timeout):
            return 'RES_SEARCH_RESULT', [
                ('uid=thing1', {'foo':[], 'baz':['a','b']}),
                ('uid=thing2', {'foo':['spam'], 'bar':['999']}),
            ]

        result = staticmethod(result)

but LDAPCursor.__iter__(self)
loops while restype != RES_SEARCH_RESULT

where 
Python 2.3.5 (#2, Mar 26 2005, 17:32:32)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ldap
>>> print ldap.RES_SEARCH_RESULT
101

to fix this, you would need to try to import the ldap-module like it is
done in
peak/storage/LDAP.py

cheers
Ulrich


On Tue, 2005-04-12 at 16:55 -0400, Phillip J. Eby wrote:
> At 07:40 PM 04/12/2005 +0200, Ulrich Eck wrote:
> >Hi Phillip,
> >
> >i just upgraded to the latest cvs of PEAK and rerun the tests.
> >
> >
> >at this test:
> >...
> >testMergeHistory (peak.storage.tests.test_undo.HistoryTests) ... ok
> >testBasics (peak.storage.tests.test_undo.UndoTests) ... ok
> >testUndoRedo (peak.storage.tests.test_undo.UndoTests) ... ok
> >**checkConversions (peak.storage.tests.LDAP.LDAPSchemaTest) ...
> >
> >the process hangs and eats all mem and cpu.
> >....
> >what should i do to help you tracking down the problem ?
> 
> Edit the 'checkConversions()' method and add 'import pdb; pdb.set_trace()' 
> so you get into the debugger.  Then single-step until you find the 
> statement that hangs.  Rerun it and step to just before the hang, then get 
> a stack trace ('w' command in pdb) and print any variables you think are 
> relevant.
> 
-- 




More information about the PEAK mailing list