Full_Name: Quanah Gibson-Mount
Version: RE_23
OS: Linux 2.6 (64-bit)
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (171.64.19.81)
In testing the RE_23 tree, I put it under hoard after everything passed using
glibc as the memory allocator. I found that if I enable dynlist:
moduleload dynlist.la
then in my database section add:
# Dynlist Overlay
overlay dynlist
dynlist-attrset groupOfURLS memberURL member
slapd will core dump on startup with:
Loaded symbols for /usr/local/lib/openldap/dynlist-2.3-releng.so.0
#0 0x00002ab7651490c9 in malloc () from /usr/local/lib/libhoard.so
(gdb) bt
#0 0x00002ab7651490c9 in malloc () from /usr/local/lib/libhoard.so
#1 0x00002ab765149e38 in realloc () from /usr/local/lib/libhoard.so
#2 0x00002ab76554f890 in ber_memrealloc_x (p=Variable "p" is not available.
) at memory.c:354
#3 0x00002ab76542bf88 in ldap_charray_add (a=0x7fff45a7eec0, s=0x2ab7667c2518
"olcConnMaxPending") at charray.c:49
#4 0x000000000045e9f9 in matching_rule_use_init () at mr.c:364
#5 0x0000000000459f62 in slap_schema_check () at schema_prep.c:1368
#6 0x0000000000415f1b in main (argc=3, argv=0x7fff45a7f0b8) at main.c:711
It looks like there's soemthing incorrect in the way it is allocating memory on
startup.
--Quanah
quanah(a)stanford.edu wrote:
>> I don't know if the people who are in charge to build a RPM are paying
>> attention to what they are doing or not.
>>
>> You can do a man ldap_init, and then look at /usr/include/ldap.h for the
>> function definition.
>>
>> I am not a LDAP expert or anything close to that. But it seems to me that
>> function called ldap_init has already been replaced by the function called
>> ldap_initialize, and they take even different set of parameters.
>>
>> And yet the manpage not only didn't reflect that change, but enforce the
>> wrong idea of using ldap_init function by having ldap_init in manpages.
>>
>> An extremely poor job done by the package maintainer.
>
> Hi,
>
> I suggest you complain to RedHat if you don't like the way they've packaged
> something. The OpenLDAP foundation is not responsible for the way in which
> RedHat packages its releases. In any case, if you are taking the time to
> read the header file, then pay close attention to the following:
>
> #if LDAP_DEPRECATED
> LDAP_F( LDAP * )
> ldap_init LDAP_P(( /* deprecated, use ldap_create or ldap_initialize */
> LDAP_CONST char *host,
> int port ));
>
>
> I.e., ldap_init is a deprecated function, and ldap_initialize should be
> used instead. However, there are many programs out there that still use
> the old API, so the old functions are maintained for backwards
> compatibility purposes. Hence the man page.
I'd add that OpenLDAP is a voluntary based project, and volunteers
devote their efforts to what they consider mostly important - typically
writing good useful code that runs (fast). Man pages typically lag
behind, but eventually they get updated/fixed (as they are in currently
released code). If you cared so much about up-to-date code and man
pages, you would be using the latest release, not a 15 months old one.
And if you were able to infer the really useful API from ldap.h, you
could have more proficiently spent your time by writing and submitting a
useful man page, instead of just complaining quite unpolitely.
p.
Ing. Pierangelo Masarati
OpenLDAP Core Team
SysNet s.n.c.
Via Dossi, 8 - 27100 Pavia - ITALIA
http://www.sys-net.it
------------------------------------------
Office: +39.02.23998309
Mobile: +39.333.4963172
Email: pierangelo.masarati(a)sys-net.it
------------------------------------------
--On Monday, April 02, 2007 5:23 PM +0000 wweng(a)kencast.com wrote:
> Full_Name: Wei Weng
> Version: 2.3.19
> OS: Linux(Fedora 5)
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (69.120.101.108)
>
>
> I don't know if the people who are in charge to build a RPM are paying
> attention to what they are doing or not.
>
> You can do a man ldap_init, and then look at /usr/include/ldap.h for the
> function definition.
>
> I am not a LDAP expert or anything close to that. But it seems to me that
> function called ldap_init has already been replaced by the function called
> ldap_initialize, and they take even different set of parameters.
>
> And yet the manpage not only didn't reflect that change, but enforce the
> wrong idea of using ldap_init function by having ldap_init in manpages.
>
> An extremely poor job done by the package maintainer.
Hi,
I suggest you complain to RedHat if you don't like the way they've packaged
something. The OpenLDAP foundation is not responsible for the way in which
RedHat packages its releases. In any case, if you are taking the time to
read the header file, then pay close attention to the following:
#if LDAP_DEPRECATED
LDAP_F( LDAP * )
ldap_init LDAP_P(( /* deprecated, use ldap_create or ldap_initialize */
LDAP_CONST char *host,
int port ));
I.e., ldap_init is a deprecated function, and ldap_initialize should be
used instead. However, there are many programs out there that still use
the old API, so the old functions are maintained for backwards
compatibility purposes. Hence the man page.
This ITS will be closed.
Regards,
Quanah
--
Quanah Gibson-Mount
Senior Systems Software Developer
ITS/Shared Application Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
Full_Name: Wei Weng
Version: 2.3.19
OS: Linux(Fedora 5)
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (69.120.101.108)
I don't know if the people who are in charge to build a RPM are paying attention
to what they are doing or not.
You can do a man ldap_init, and then look at /usr/include/ldap.h for the
function definition.
I am not a LDAP expert or anything close to that. But it seems to me that
function called ldap_init has already been replaced by the function called
ldap_initialize, and they take even different set of parameters.
And yet the manpage not only didn't reflect that change, but enforce the wrong
idea of using ldap_init function by having ldap_init in manpages.
An extremely poor job done by the package maintainer.
--On Saturday, March 31, 2007 12:54 AM +0000 quanah(a)stanford.edu wrote:
> --On Friday, March 30, 2007 2:25 PM +0000 chris.ridd(a)isode.com wrote:
>
>> Full_Name: Chris Ridd
>> Version: 2.3.34
>> OS: Windows
>> URL: ftp://ftp.openldap.org/incoming/
>> Submission from: (NULL) (62.3.217.250)
>>
>>
>> On Windows, it is important that mallocs done in one DLL are balanced by
>> frees done from the same DLL. Failure to do this consistently leads to
>> heap corruption.
>>
>> This was observed to occur in several places in ldapadd - several buffers
>> allocated by ber_memfree() were freed using free().
>>
>> Our customer has successfully used a version of ldapadd on Windows
>> containing this patch (and the one in ITS 4900.)
>
> Thanks, testing.
--- openldap-2.3.34/clients/tools/common.c.orig Fri Mar 30 15:17:32 2007
+++ openldap-2.3.34/clients/tools/common.c Fri Mar 30 15:21:42 2007
@@ -1244,7 +1244,7 @@
crit ? "critical " : "" );
}
- free( ctrls );
+ ldap_controls_free( ctrls );
if ( crit ) {
exit( EXIT_FAILURE );
}
Just to note, this part of the patch is bad. ctrls is a pointer to an
array of controls, not an array of controls itself. Therefore, the use of
"free" here is appropriate. Using ldap_controls_free results in segfaults.
--Quanah
--
Quanah Gibson-Mount
Senior Systems Software Developer
ITS/Shared Application Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
--On Friday, March 30, 2007 2:25 PM +0000 chris.ridd(a)isode.com wrote:
> Full_Name: Chris Ridd
> Version: 2.3.34
> OS: Windows
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (62.3.217.250)
>
>
> On Windows, it is important that mallocs done in one DLL are balanced by
> frees done from the same DLL. Failure to do this consistently leads to
> heap corruption.
>
> This was observed to occur in several places in ldapadd - several buffers
> allocated by ber_memfree() were freed using free().
>
> Our customer has successfully used a version of ldapadd on Windows
> containing this patch (and the one in ITS 4900.)
Thanks, testing.
--Quanah
--
Quanah Gibson-Mount
Senior Systems Software Developer
ITS/Shared Application Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
--On Friday, March 30, 2007 2:09 PM +0000 chris.ridd(a)isode.com wrote:
> Full_Name: Chris Ridd
> Version: 2.3.34
> OS: Windows
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (62.3.217.250)
>
>
> On Windows, the ldapadd tool often crashes while parsing the command-line
> arguments.
Hi Chris,
We formally dropped support for MSVC a long time ago. That being said,
working build of OpenLDAP was accomplished with MSVCC a few months ago
without hitting this issue. Which version of MSVC is being used, and
please doublecheck the conditions spelled out in the comments in
<ldap_cdefs.h>, where it starts with "Support for Windows DLLs".
Also, instead of declaring things as extern, does changing LDAP_LIBC_V to
LDAP_LUTIL_V resolve your issue?
--Quanah
--
Quanah Gibson-Mount
Senior Systems Software Developer
ITS/Shared Application Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
Full_Name: Chris Ridd
Version: 2.3.34
OS: Windows
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (62.3.217.250)
On Windows, it is important that mallocs done in one DLL are balanced by frees
done from the same DLL. Failure to do this consistently leads to heap
corruption.
This was observed to occur in several places in ldapadd - several buffers
allocated by ber_memfree() were freed using free().
Our customer has successfully used a version of ldapadd on Windows containing
this patch (and the one in ITS 4900.)
Patch follows:
--- openldap-2.3.34/clients/tools/common.c.orig Fri Mar 30 15:17:32 2007
+++ openldap-2.3.34/clients/tools/common.c Fri Mar 30 15:21:42 2007
@@ -163,7 +163,7 @@
N_(" -n show what would be done but don't actually do it\n"),
N_(" -O props SASL security properties\n"),
N_(" -p port port on LDAP server\n"),
-N_(" -P version procotol version (default: 3)\n"),
+N_(" -P version protocol version (default: 3)\n"),
N_(" -Q use SASL Quiet mode\n"),
N_(" -R realm SASL realm\n"),
N_(" -U authcid SASL authentication identity\n"),
@@ -1244,7 +1244,7 @@
crit ? "critical " : "" );
}
- free( ctrls );
+ ldap_controls_free( ctrls );
if ( crit ) {
exit( EXIT_FAILURE );
}
--- openldap-2.3.34/clients/tools/ldapmodify.c.orig Fri Mar 30 15:19:34
2007
+++ openldap-2.3.34/clients/tools/ldapmodify.c Fri Mar 30 15:21:07 2007
@@ -389,8 +389,8 @@
fprintf( rejfp, "\n%s\n", rejbuf );
}
- if (rejfp) free( rejbuf );
- free( rbuf );
+ if (rejfp) ber_memfree( rejbuf );
+ ber_memfree( rbuf );
}
#ifdef LDAP_GROUP_TRANSACTION
@@ -519,7 +519,7 @@
printf(_("%s: skipping change record for entry:
%s\n"),
prog, dn);
printf(_("\t(LDAP host/port does not match
replica: lines)\n"));
- free( dn );
+ ber_memfree( dn );
ber_memfree( type );
ber_memfree( val.bv_val );
return( 0 );
@@ -727,13 +727,13 @@
}
if ( dn != NULL ) {
- free( dn );
+ ber_memfree( dn );
}
if ( newrdn != NULL ) {
- free( newrdn );
+ ber_memfree( newrdn );
}
if ( newsup != NULL ) {
- free( newsup );
+ ber_memfree( newsup );
}
if ( pmods != NULL ) {
ldap_mods_free( pmods, 1 );
Full_Name: Chris Ridd
Version: 2.3.34
OS: Windows
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (62.3.217.250)
On Windows, the ldapadd tool often crashes while parsing the command-line
arguments.
This is due to a defect in the way the optarg (et al) variables are declared in
ac/unistd.h. When tools/common.c includes that file, the 4 variables end up
being declared as being "imported" from a DLL. However they're *actually*
present in a static archive that's linked into the ldapadd executable, which is
apparently not the same sort of thing. (Visual Studio's compiler warns about
inconsistent linkage :-)
As a result, the code in getopt.c thinks that optarg is a variable at one
address, and the code calling getopt() think that optarg is a variable at a
*different* address (NULL in my test rig). Clearly that's not right, and it
causes a variety of issues:
-D <dn> copies optarg using strdup(NULL), which returns NULL.
-w <passwd> scribbles over the passwd string, which crashes doing a *optarg
because optarg is NULL.
A simple fix is to redeclare the 4 variables as just "extern" instead of
LDAP_LIBC_V. Diff follows...
--- openldap-2.3.34/include/ac/unistd.h.orig Fri Mar 30 15:05:49 2007
+++ openldap-2.3.34/include/ac/unistd.h Fri Mar 30 15:06:10 2007
@@ -54,8 +54,8 @@
#else
/* assume we need to declare these externs */
- LDAP_LIBC_V (char *) optarg;
- LDAP_LIBC_V (int) optind, opterr, optopt;
+ extern char * optarg;
+ extern int optind, opterr, optopt;
#endif
/* use lutil file locking */
--On Thursday, March 22, 2007 5:25 PM +0000 docelic(a)mail.inet.hr wrote:
> Full_Name: Davor Ocelic
> Version: CVS-HEAD
> OS: Linux
> URL: http://www.hcoop.net/~docelic/openldap-slapd.overlays.defvals.patch
> Submission from: (NULL) (213.147.110.16)
>
>
>
> Hello,
>
> Attached is a patch which adds a "Default Attribute Values" functionality
> to OpenLDAP. It is implemented as an overlay named "defvals", and the
> patch is done against cvs-head of today.
>
> Complete documentation is included in the slapo-defvals(5) manual page.
> The overlay code itself is commented as well, as a help for others writing
> overlays.
>
> Feel free to trim comments or improve code as you see fit.
Hi Davor,
I believe you'll need to complete the attribution bit detailed here:
<http://www.openldap.org/devel/contributing.html>
for this to be included.
--Quanah
--
Quanah Gibson-Mount
Senior Systems Software Developer
ITS/Shared Application Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html