(ITS#5019) slapd: ldbm/gdbm, cache.c core dump
by asedlack@mailfoundry.com
Full_Name: Aron Sedlack
Version: 2.3.35
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (66.18.18.14)
Platform: Linux, OpenLDAP-2.3.35
Compiled with: ./configure --enable-dynamic --enable-wrappers --enable-bdb=no
--enable-hdb=no --enable-ldbm --enable-ldbm-api=gdbm --with-threads --with-tls
--with-threads=no
gcc version 3.3.4, gdbm 1.8.3, OpenSSL 0.9.8e
slapd core dumps with a corrupted stack, SIGABRT.
slapd: cache.c:111: cache_return_entry_rw: Assertion `e->e_private != (( void
*)0)' failed..
Happens every time ldif is loaded...
$ ldapmodify -a -f ./mf.ldif -D "cn=Root,dc=mf" -w secret
adding new entry "dc=mf"
adding new entry "dc=iana,dc=mf"
ldap_result: Can't contact LDAP server (-1)
15 years, 11 months
Re: (ITS#5018) memory leak
by h.b.furuseth@usit.uio.no
niloulili(a)hotmail.com writes:
> if ( (ld = ldap_init("192.xxx.xxx.xxx",389 ))== NULL )
> return 1;
> if ( ldap_simple_bind_s( ld,"CN=nina
> wang,CN=Users,DC=ldap,DC=qtier,DC=com","0000" ) != LDAP_SUCCESS )
> {
> ldap_perror( ld, "ldap_simple_bind_s" );
insert "ldap_unbind( ld );" here. Does that fix the problem?
That's how to free the LDAP* structure.
In LDAP, "unbind" is the "disconnect" command, it's not the
opposite of "bind". The misleading name came about because
originally one had to bind after connect.
> return 1;
> }
> ldap_msgfree( res );
res == NULL here in this particular code, so you can drop
this and the declaration of 'res'.
> /* close and free connection resources */
> ldap_unbind( ld );
> return 0;
> }
--
Regards,
Hallvard
15 years, 11 months
Re: (ITS#5016) slapd generates unjustified error 3 (Time Limit Exceeded) at checkpoint time
by ando@sys-net.it
ali.pouya(a)free.fr wrote:
> What bothers me is that the regular client requests to the consumer receive
> (scarcely and randomly) "Time Limit Exceeded" at checkpoint time.
Would it be possible to get, from the consumer's log, what was the
actually requested time limit in those cases? This means: track down
what connection/operation was concluded by a "Time Limit Exceeded"
response; then find out the corresponding request, and see what was the
requested time limit. You need "args" debug level for this purpose, and
you need to look at the second of the three numbers that end the SRCH
line in the logs; for example:
SRCH "dc=example,dc=com" 2 0 20 5 0
filter: (uid=foobar)
attrs: 1.1
means: search "dc=example,dc=com" with scope subtree (2) and never deref
aliases (0), using a size limit of 20, a timelimit of 5 and no attrsonly
(0).
p.
Ing. Pierangelo Masarati
OpenLDAP Core Team
SysNet s.r.l.
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
---------------------------------------
15 years, 11 months
Re: (ITS#4943) tpool.c pause vs. finish
by h.b.furuseth@usit.uio.no
Howard Chu writes:
> Hallvard B Furuseth wrote:
>> hyc(a)symas.com writes:
>>> h.b.furuseth(a)usit.uio.no wrote:
>>>> * When a thread is finishing, make it go active for context_reset().
>>>> Should make slapi module destructors safer, and I don't see that it
>>>> can hurt.
>>> I don't understand this.
>>
>> Let me dig a bit back in the ITS...
>> "context_reset() can call connection_fake_destroy(), which via
>> slapi_int_free_object_extensions() calls slapi module destructors,
>> which can do who-knows-what."
>
> context_reset() can only be called from the main thread. It can (must)
> never be called by anything running from the pool.
It's called from pool_wrapper(). pool_wrapper() could go active so
there can be no pause while that context_reset() call is running.
>>>> * Scheduling: If several threads call pool_pause(), (...)
(need to check out how it should work...)
>>>> - pool_context() breaks if several ldap_pvt_thread_t bit patterns can
>>>> represent the same thread ID: TID_HASH() would give different hashes
>>>> for the same thread, and pool_context() stops searching when it hits
>>>> a slot with ctx == NULL. (My previous bug report was a bit wrong.)
>>>
>>> How can a single thread ID be represented by multiple bit patterns?
>>
>> A struct/union with padding bytes seems the least unlikely possibility.
Note that I did say "least unlikely" rather than "most likely":
It's not that I expect to encounter it, more that I'd prefer not to be
surprised in the form of a slapd malfuntion.
So in that respect, my preference (not for RE23) is to cast to an
integer for the hash, and also to add pthread_<set/get>specific() so
thread_keys[] and its hash will only be a fallback solution.
> Any implementation that leaves uninitialized padding bytes would be a
> bug. Tools like valgrind would barf all over them.
No. Valid compiler, valid code. Therefore valgrind is silent about
copying uninitialized values, it only complains when you use them for
something - like write() or arithmetic. So a valgrind complaint about
an uninitialized _value_ isn't necessary at the point the uninitialized
_variable_ is read. E.g. this complains in printf(), not in foo():
int foo()
{
struct { char c; /*maybe padding here*/ int j; } s;
s.c = 1;
s.j = 2;
return ((unsigned char *)&s)[1]; /* maybe padding byte */
}
int main()
{
printf("%d\n", foo());
}
>> A pointer in hardware where several address representations map to the
>> same physical address, and the compiler handles that by normalizing
>> pointers when they are compared/subtracted. Like DOS "huge" pointers
>> would have been if the compiler normalized them when comparing them
>> instead of when incrementing/decrementing them. 20-bit address bus,
>> 32-bit pointers, physical address = 16 * <segment half of pointer> +
>> <offset half of pointer>.
>
> Nobody voluntarily uses such memory models today. The very mention of "DOS"
> invalidates this discussion since there is no threading environment there.
Right, at this point I answered how it _can_ happen, not why I expect to
encounter it. I could see the demands of hardware design cause strange
memory models to proliferate again, but I'm not holding my breath.
I'd be a bit less surprised to encounter integers with padding bits
again, but not for a simple ID type, and hashing an integer instead of
its bytes would fix it anyway.
>>> The best fix may be to just use the address of the thread's stack as the
>>> thread ID. That's actually perfect for our purpose.
>>
>> How does a function called from somewhere inside the thread know that
>> address? That's almost what the user context is, and thus what
>> thread_keys[] maps the thread ID to.
>
> It requires some degree of machine-dependence, which is why I never
> bothered to code it. The principle is simple though - all of our thread
> stacks are some multiple of 1MB in size. Take the address of any local
> variable, mask off the low 20 bits, and you have a unique thread ID (+/-
> some additional masking/shifting based on the actual thread stack size).
I'm not sure how to determine _which_ multiple of 1MB - start two
threads and compare their stack addresses, maybe? In any case, I
agree it sounds rather more machine-dependent than the current code.
--
Regards,
Hallvard
15 years, 11 months
Re: (ITS#5016) slapd generates unjustified error 3 (Time Limit Exceeded) at checkpoint time
by ali.pouya@free.fr
Selon Pierangelo Masarati <ando(a)sys-net.it>:
> ali.pouya(a)free.fr wrote:
>
> > Hi,
> > I use openldap 2.3.35 with the following bdb configuration.
> >
> > database bdb
> > ....
> > checkpoint 1000000 10
> >
> > In my DB_CONFIG file I have :
> >
> > set_flags DB_LOG_AUTOREMOVE
> >
> > There ise a great LDAP read/write activity on my server.
> >
> > I notice that every 10 minutes some of my search requests receive randomly
> an
> > error 3 (Time Limit Exceeded) within one or two seconds while I'm using the
> > slapd default timelimit (3600 seconds).
> >
> > I think a relation exists between this error and the checkpoint activity
> (slapd
> > is inclined to generate unjustified error 3 at checkpoint time) .
> > Is it possible to study this problem ?
> >
> > I can send more information if required.
>
>
> Do you mean that regular requests (to the producer or to the consumer?)
> often receive "Time Limit Exceeded", or that the replication requests
> issued by the consumer receive "Time Limit Exceeded" from the producer?
>
> p.
>
>
>
> Ing. Pierangelo Masarati
> OpenLDAP Core Team
>
> SysNet s.r.l.
> 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
> ---------------------------------------
>
>
>
Hi Pierangelo;
What bothers me is that the regular client requests to the consumer receive
(scarcely and randomly) "Time Limit Exceeded" at checkpoint time.
The replication requests to the master also receive this error after 3600
seconds when I'm synchronizing a new empty replica (as though I set timelimit
unlimited for the sync client), but this is not a problem for me because the
syncrepl client makes a new connection to the master and everything works well.
Best regards
Ali
15 years, 11 months
Re: (ITS#5016) slapd generates unjustified error 3 (Time Limit Exceeded) at checkpoint time
by ando@sys-net.it
ali.pouya(a)free.fr wrote:
> Hi,
> I use openldap 2.3.35 with the following bdb configuration.
>
> database bdb
> ....
> checkpoint 1000000 10
>
> In my DB_CONFIG file I have :
>
> set_flags DB_LOG_AUTOREMOVE
>
> There ise a great LDAP read/write activity on my server.
>
> I notice that every 10 minutes some of my search requests receive randomly an
> error 3 (Time Limit Exceeded) within one or two seconds while I'm using the
> slapd default timelimit (3600 seconds).
>
> I think a relation exists between this error and the checkpoint activity (slapd
> is inclined to generate unjustified error 3 at checkpoint time) .
> Is it possible to study this problem ?
>
> I can send more information if required.
Do you mean that regular requests (to the producer or to the consumer?)
often receive "Time Limit Exceeded", or that the replication requests
issued by the consumer receive "Time Limit Exceeded" from the producer?
p.
Ing. Pierangelo Masarati
OpenLDAP Core Team
SysNet s.r.l.
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
---------------------------------------
15 years, 11 months
(ITS#5018) memory leak
by niloulili@hotmail.com
Full_Name: nina wang
Version: 2.2.19
OS: Vxworks mips
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (222.68.187.35)
I remove these code from linux to gcc.
a computer equipmented os win 2000 server acts as server setting up AD .
i start a thread to init a ldap connection and bind them with a valid account
and password,configured in server. then unbind them every several seconds.
through special tools ,i can see that free memory always being decreasing.
if i only do action ldap_init,without bind to server,no the said scene .
THE CODE IS :
{
LDAP *ld;
LDAPMessage *res=NULL, *e;
int i;
char *a, *dn;
BerElement *ptr;
char **vals;
/* open a connection */
if ( (ld = ldap_init("192.xxx.xxx.xxx",389 ))== NULL )
return 1;
if ( ldap_simple_bind_s( ld,"CN=nina
wang,CN=Users,DC=ldap,DC=qtier,DC=com","0000" ) != LDAP_SUCCESS )
{
ldap_perror( ld, "ldap_simple_bind_s" );
return 1;
}
ldap_msgfree( res );
/* close and free connection resources */
ldap_unbind( ld );
return 0;
}
Hope to receive your response soon. Thank you .
15 years, 11 months
(ITS#5017) slapd generates unjustified error 3 (Time Limit Exceeded) at checkpoint time
by ali.pouya@free.fr
Full_Name: Ali Pouya
Version: 2.3.35
OS: Linux RedHat AS4 (kernel 2.6)
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (145.242.3.30)
Hi,
I use openldap 2.3.35 with the following bdb configuration.
database bdb
....
checkpoint 1000000 10
In my DB_CONFIG file I have :
set_flags DB_LOG_AUTOREMOVE
There ise a great LDAP read/write activity on my server.
I notice that every 10 minutes some of my search requests receive randomly an
error 3 (Time Limit Exceeded) within one or two seconds while I'm using the
slapd default timelimit (3600 seconds).
I think a relation exists between this error and the checkpoint activity (slapd
is inclined to generate unjustified error 3 at checkpoint time) .
Is it possible to study this problem ?
I can send more information if required.
Thanks for your help
Best regards
Ali Pouya
15 years, 11 months
(ITS#5016) slapd generates unjustified error 3 (Time Limit Exceeded) at checkpoint time
by ali.pouya@free.fr
Full_Name: Ali Pouya
Version: 2.3.35
OS: Linux RedHat AS4 (kernel 2.6)
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (145.242.3.30)
Hi,
I use openldap 2.3.35 with the following bdb configuration.
database bdb
....
checkpoint 1000000 10
In my DB_CONFIG file I have :
set_flags DB_LOG_AUTOREMOVE
There ise a great LDAP read/write activity on my server.
I notice that every 10 minutes some of my search requests receive randomly an
error 3 (Time Limit Exceeded) within one or two seconds while I'm using the
slapd default timelimit (3600 seconds).
I think a relation exists between this error and the checkpoint activity (slapd
is inclined to generate unjustified error 3 at checkpoint time) .
Is it possible to study this problem ?
I can send more information if required.
Thanks for your help
Best regards
Ali Pouya
15 years, 11 months