[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: (ITS#4355) slapd crash



On Thu, 2006-01-19 at 20:58 +0000, Spicer, Kevin wrote:

> > 2) print "desc":
> > 	p ((AttributeDescription *)0x390800)[0]
> 
> (gdb) p((AttributeDescription *)0x390800)[0]
> $1 = {ad_next = 0x0, ad_type = 0x391188, ad_cname = {bv_len = 14,
>     bv_val = 0x3c3a00 "pwdFailureTime"}, ad_tags = {bv_len = 0, bv_val = 0x0},
>   ad_flags = 0}

OK; that's pwdFailureTime, which has generalizedTimeMatch as equality
rule and thus has a normalizer.

> 
> > 3) print "mod":
> >	p ((struct berval *)0x2522770)[0]@2
> 
> (gdb) p ((struct berval *)0x2522770)[0]@2
> $2 = {{bv_len = 0, bv_val = 0x390800 ""}, {bv_len = 14,
>     bv_val = 0x3c3a00 "pwdFailureTime"}}

Sorry, I pasted the wrong pointer; that should have been 0x2967558;
however, I assume it points to a one-value generalized time.

> 
> > >From the values you get for the temporaries in attr_merge(), print
> > (you'll need to cast them first; replace the name with the pointer):
> 
> > p ((Attribute **)a)[0][0]
> 
> (gdb) up
> #1  0xfefd09c4 in raise () from /usr/lib/libc.so.1
> (gdb) up
> #2  0xfefb6ce0 in abort () from /usr/lib/libc.so.1
> (gdb) up
> #3  0xfefb6f80 in _assert () from /usr/lib/libc.so.1
> (gdb) up
> #4  0x0005b48c in attr_merge (e=0xf7ffeeb0, desc=0x390800, vals=0x2967558,
>     nvals=0x0) at attr.c:210
> 210                     assert( ( nvals == NULL && (*a)->a_nvals == (*a)->a_vals )
> (gdb) p ((Attribute **)a)[0][0]
> $3 = {a_desc = 0x390800, a_vals = 0x2997668, a_nvals = 0x2997698,
>   a_next = 0x0, a_flags = 0}

OK, a_vals and a_nvals differ, while NULL is passed as nvals; this
triggers the assertion.  

I'm unsure about how this could have happened, I suspect the value was
replicated, and thus passed thru normalization; does it make sense?

I think this can be fixed in two different manners:

1) simple hack: provide normalized values as well in ppolicy

2) more general approach: replace that assertion with some "smart" code
that takes care of copying a_vals into a_nvals if the two pointers are
equal and (nvals != NULL && nvals != vals) is passed and, conversely,
appends vals to a_nvals if nvals == NULL is passed and a_nvals !=
a_vals.

p.




Ing. Pierangelo Masarati
Responsabile Open Solution
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@sys-net.it
------------------------------------------