problem using python-ldap under fcgi

Matt Bartolome mattxbart at gmail.com
Wed Aug 27 22:12:23 CEST 2008


My apologies on the wild goose chase but after using valgrind on my
fcgi process it is python cx_Oracle (would have never guessed that!)
which triggers the segmentation fault when ldap.initialize() is
called. Why it does this is beyond me but a simple alteration of my
code makes the problem go away completely. I was creating a global
oracle db cursor which I'm now creating inside the functions that use
it.

I'm not sure about the glib c error and patch now. Using the original
release without modification works so I will leave it at that.

Thanks,
Matt

On Wed, Aug 27, 2008 at 12:26 AM, Michael Ströder <michael at stroeder.com> wrote:
> Matt Bartolome wrote:
>>
>> Hey Michael. Thank you for your response. I modified LDAPObject.c and
>> ldapcontrol.c to use the solution described here:
>>
>> https://bugs.launchpad.net/ubuntu/+source/python-cdb/+bug/157251
>>
>> Looks like it is something specific to glibc in ubuntu and the
>> "recommended" use of PyObject_Del instead of PyMem_DEL. I've attached
>> a patch showing the modifications for anyone else ripping their hair
>> out. The glibc python free() error is now gone.
>
> If this is really a more general issue I'd like to see this fixed. So I
> tried your patch. But it seg faults on my openSUSE 11.0 system. I noticed
> some warnings during build (see below).
>
> Ciao, Michael.
>
> --------------------------- snip ---------------------------
> [..]
> Modules/LDAPObject.c: In function 'Tuple_to_LDAPMod':
> Modules/LDAPObject.c:126: warning: passing argument 1 of '_PyObject_New'
> makes pointer from integer without a cast
> Modules/LDAPObject.c:134: warning: passing argument 1 of '_PyObject_New'
> makes pointer from integer without a cast
> Modules/LDAPObject.c:143: warning: passing argument 1 of '_PyObject_New'
> makes pointer from integer without a cast
> Modules/LDAPObject.c:146: warning: passing argument 1 of '_PyObject_New'
> makes pointer from integer without a cast
> Modules/LDAPObject.c:154: warning: passing argument 1 of '_PyObject_New'
> makes pointer from integer without a cast
> Modules/LDAPObject.c:158: warning: passing argument 1 of '_PyObject_New'
> makes pointer from integer without a cast
> Modules/LDAPObject.c: In function 'List_to_LDAPMods':
> Modules/LDAPObject.c:226: warning: passing argument 1 of '_PyObject_New'
> makes pointer from integer without a cast
> Modules/LDAPObject.c: In function 'attrs_from_List':
> Modules/LDAPObject.c:273: warning: passing argument 1 of '_PyObject_New'
> makes pointer from integer without a cast
> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
> -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS
> -DLDAPMODULE_VERSION=2.3.6 -IModules -I/opt/openldap-HEAD/include
> -I/opt/sasl/include/sasl -I/usr/include/sasl -I/usr/include/python2.6 -c
> Modules/ldapcontrol.c -o build/temp.linux-i686-2.6/Modules/ldapcontrol.o -g
> Modules/ldapcontrol.c: In function 'Tuple_to_LDAPControl':
> Modules/ldapcontrol.c:83: warning: passing argument 1 of '_PyObject_New'
> makes pointer from integer without a cast
> Modules/ldapcontrol.c:92: warning: passing argument 1 of '_PyObject_New'
> makes pointer from integer without a cast
> Modules/ldapcontrol.c: In function 'List_to_LDAPControls':
> Modules/ldapcontrol.c:139: warning: passing argument 1 of '_PyObject_New'
> makes pointer from integer without a cast
> [..]
>



More information about the python-ldap mailing list