#47455 valgrind - value mem leaks, uninit mem usage
Closed: Fixed None Opened 6 years ago by rmeggins.

This breaks slapi-nis.
https://git.fedorahosted.org/cgit/slapi-nis.git/tree/src/back-sch.c#n581

dn: cn=ng1,cn=ng,cn=compat,cn=accounts,dc=example,dc=com
objectClass: nisNetgroup
memberNisNetgroup: ng2
memberNisNetgroup: ng3
memberNisNetgroup: ng3

becomes

dn: cn=ng1,cn=ng,cn=compat,cn=accounts,dc=example,dc=com
objectClass: nisNetgroup
memberNisNetgroup: ng3

but it should be
dn: cn=ng1,cn=ng,cn=compat,cn=accounts,dc=example,dc=com
objectClass: nisNetgroup
memberNisNetgroup: ng2
memberNisNetgroup: ng3

That is, slapi_str2entry should just throw out the duplicate ng3 value and keep the ng2 value


valgrind errors and leaks fixed by patch
slapd.vg.22729

In valueset_relace_valuearray_ext() if you use PASSIN for slapi_valueset_add_attr_valuearray_ext and it returns an error, wouldn't then
slapi_valueset_free(vs_new);
valuearray_free(&valstoreplace);
potentially contain double frees ?
I think the call to slapi_valueset_add_attr_valuearray_ext misses also the DUPCHECK flag, depending on the dupcheck parameter.

0001-Ticket-47455-valgrind-value-mem-leaks-uninit-mem-usa.patch
0001-Ticket-47455-valgrind-value-mem-leaks-uninit-mem-usa.patch

Sorry, one more question ...

I see some slapi_valueset_add_attr_valuearray_ext called with SLAPI_VALUE_FLAG_PASSIN in entrywsi.c where the return value is not being checked... I guess we can assume there's no chance to see any error occurs there?

Replying to [comment:5 nhosoi]:

Sorry, one more question ...

I see some slapi_valueset_add_attr_valuearray_ext called with SLAPI_VALUE_FLAG_PASSIN in entrywsi.c where the return value is not being checked... I guess we can assume there's no chance to see any error occurs there?

There are no errors returned when using PASSIN. The only time errors are returned is with the DUPCHECK flag - then an error will be returned if a duplicate is found.

To ssh://git.fedorahosted.org/git/389/ds.git
df53a87..5633e12 389-ds-base-1.3.1 -> 389-ds-base-1.3.1
commit 5633e12
Author: Rich Megginson rmeggins@redhat.com
Date: Mon Jul 29 15:06:03 2013 -0600
ed89524..39648c7 master -> master
commit 39648c7
Author: Rich Megginson rmeggins@redhat.com
Date: Mon Jul 29 15:06:03 2013 -0600

fcf4154..aae4989 389-ds-base-1.3.1 -> 389-ds-base-1.3.1
commit aae4989
Author: Rich Megginson rmeggins@redhat.com
Date: Wed Jul 31 18:21:42 2013 -0600
91c2c57..39f5eda master -> master
commit 39f5eda
Author: Rich Megginson rmeggins@redhat.com
Date: Wed Jul 31 18:21:42 2013 -0600

suggested fix, definitely needs to be reviewed
dup.patch

fix for netgroups 0001-Ticket-47455-valgrind-value-mem-leaks-uninit-mem-usa.patch
0001-Ticket-47455-valgrind-value-mem-leaks-uninit-mem-usa.2.patch

To ssh://git.fedorahosted.org/git/389/ds.git
060c05c..6357ced 389-ds-base-1.3.1 -> 389-ds-base-1.3.1
commit 6357ced
Author: Rich Megginson rmeggins@redhat.com
Date: Thu Sep 5 19:45:44 2013 -0600
ba00d48..3adc242 master -> master
commit 3adc242
Author: Rich Megginson rmeggins@redhat.com
Date: Thu Sep 5 19:45:44 2013 -0600

git patch file (1.2.11) -- Backported the valueset.c part for Ticket #346 "version 4 Slow ldapmodify operation time for large quantities of multi-valued attribute values"
0005-Ticket-47455-valgrind-value-mem-leaks-uninit-mem-usa.patch

Metadata Update from @rmeggins:
- Issue assigned to rmeggins
- Issue set to the milestone: 1.3.1.8

2 years ago

Login to comment on this ticket.

Metadata