Re: (ITS#8014) minor memleak in slapadd
by leo@yuriev.ru
This is a multi-part message in MIME format.
--------------020803010305090509060904
Content-Type: text/plain; charset=windows-1251; format=flowed
Content-Transfer-Encoding: 7bit
Please review attached patch and merge.
Leonid.
---
The attached files is derived from OpenLDAP Software. All of the
modifications
to OpenLDAP Software represented in the following patch(es) were
developed by
Peter-Service LLC, Moscow, Russia. Peter-Service LLC has not assigned
rights
and/or interest in this work to any party. I, Leonid Yuriev am
authorized by
Peter-Service LLC, my employer, to release this work under the following
terms.
Peter-Service LLC hereby places the following modifications to OpenLDAP
Software
(and only these modifications) into the public domain. Hence, these
modifications may be freely used and/or redistributed for any purpose
with or without attribution and/or other notice.
--------------020803010305090509060904
Content-Type: text/x-patch;
name="its8014.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="its8014.patch"
commit 39ffdbe0abda49189d52432a4c950589a288a9c0
Author: Leo Yuriev <leo(a)yuriev.ru>
Date: 2015-01-01 23:52:14 +0300
ITS#8014: minor CSN memleak in slapadd.
diff --git a/servers/slapd/slapcommon.c b/servers/slapd/slapcommon.c
index 01a4955..73c6579 100644
--- a/servers/slapd/slapcommon.c
+++ b/servers/slapd/slapcommon.c
@@ -975,7 +975,7 @@ slap_tool_update_ctxcsn(
{
struct berval ctxdn;
ID ctxcsn_id;
- Entry *ctxcsn_e;
+ Entry *ctxcsn_e = NULL;
int rc = EXIT_SUCCESS;
if ( !(update_ctxcsn && !dryrun && sid != SLAP_SYNC_SID_MAX + 1) ) {
@@ -1093,6 +1093,11 @@ slap_tool_update_ctxcsn(
}
}
+ if (ctxcsn_e) {
+ Operation op = {0};
+ op.o_bd = be;
+ be_entry_release_w(&op, ctxcsn_e);
+ }
return rc;
}
--------------020803010305090509060904--
8 years, 4 months
Re: (ITS#8013) SIGSEGV in test_filter()
by leo@yuriev.ru
This is a multi-part message in MIME format.
--------------070304060303090304060107
Content-Type: text/plain; charset=windows-1251; format=flowed
Content-Transfer-Encoding: 7bit
Please review attached patch and merge.
Leonid.
---
The attached files is derived from OpenLDAP Software. All of the
modifications
to OpenLDAP Software represented in the following patch(es) were
developed by
Peter-Service LLC, Moscow, Russia. Peter-Service LLC has not assigned
rights
and/or interest in this work to any party. I, Leonid Yuriev am
authorized by
Peter-Service LLC, my employer, to release this work under the following
terms.
Peter-Service LLC hereby places the following modifications to OpenLDAP
Software
(and only these modifications) into the public domain. Hence, these
modifications may be freely used and/or redistributed for any purpose
with or without attribution and/or other notice.
--------------070304060303090304060107
Content-Type: text/x-patch;
name="its8013.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="its8013.patch"
commit 51051e4142a43e37bc622775e4f816d38d2e269c
Author: Leo Yuriev <leo(a)yuriev.ru>
Date: 2015-01-01 16:44:50 +0300
ITS#8013 fix rare SIGSEGV in test_filter().
Clear PS_FIX_FILTER while alter the filter in syncprov_matchops().
diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c
index 2eeda4c..53432b0 100644
--- a/servers/slapd/overlays/syncprov.c
+++ b/servers/slapd/overlays/syncprov.c
@@ -1308,7 +1308,9 @@ syncprov_matchops( Operation *op, opcookie *opc, int saveit )
/* Skip the AND/GE clause that we stuck on in front. We
would lose deletes/mods that happen during the refresh
phase otherwise (ITS#6555) */
- op2.ors_filter = ss->s_op->ors_filter->f_and->f_next;
+ assert(ss->s_op->ors_filter->f_choice == LDAP_FILTER_AND);
+ op2.ors_filter = op2.ors_filter->f_and->f_next;
+ ss->s_flags ^= PS_FIX_FILTER;
}
ldap_pvt_thread_mutex_unlock( &ss->s_mutex );
rc = test_filter( &op2, e, op2.ors_filter );
@@ -2241,6 +2243,7 @@ syncprov_detach_op( Operation *op, syncops *so, slap_overinst *on )
/* Skip the AND/GE clause that we stuck on in front */
if ( so->s_flags & PS_FIX_FILTER ) {
+ assert(op2->ors_filter->f_choice == LDAP_FILTER_AND);
op2->ors_filter = op->ors_filter->f_and->f_next;
so->s_flags ^= PS_FIX_FILTER;
} else {
@@ -2394,7 +2397,6 @@ syncprov_search_response( Operation *op, SlapReply *rs )
ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
/* syncprov_ab_cleanup will free this syncop */
return SLAPD_ABANDON;
-
} else {
ldap_pvt_thread_mutex_lock( &ss->ss_so->s_mutex );
/* Turn off the refreshing flag */
--------------070304060303090304060107--
8 years, 4 months
(ITS#8013) SIGSEGV in test_filter()
by leo@yuriev.ru
Full_Name: Leonid Yuriev
Version: 2.4-HEAD
OS: RHEL7
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (31.130.36.33)
I have previously reported on the two SIGSEGV backtraces (see a copy below).
This bug was reproduced again during our replication test.
I think that now I have found the reason - the PS_FIX_FILTER flag not cleared
after update the filter.
Patch will be available shortly.
Please review and merge.
Leonid.
===
*** Signal 11 (Segmentation fault), address is 0xb from 0x442f07
(0) /opt/openldap.devel/libexec/slapd() [0x442f07]: test_filter
/home/ly/Projects/openldap.git/servers/slapd/filterentry.c:69
(1) /opt/openldap.devel/libexec/slapd() [0x514721]: syncprov_matchops
/home/ly/Projects/openldap.git/servers/slapd/overlays/syncprov.c:1316
(2) /opt/openldap.devel/libexec/slapd() [0x514b83]: syncprov_op_mod
/home/ly/Projects/openldap.git/servers/slapd/overlays/syncprov.c:2145
(3) /opt/openldap.devel/libexec/slapd() [0x48b31a]: overlay_op_walk
/home/ly/Projects/openldap.git/servers/slapd/backover.c:662
(4) /opt/openldap.devel/libexec/slapd() [0x48b4c1]: over_op_func
/home/ly/Projects/openldap.git/servers/slapd/backover.c:724
(5) /opt/openldap.devel/libexec/slapd() [0x4811a6]: syncrepl_entry
/home/ly/Projects/openldap.git/servers/slapd/syncrepl.c:3177
do_syncrep2
/home/ly/Projects/openldap.git/servers/slapd/syncrepl.c:10%0
(6) /opt/openldap.devel/libexec/slapd() [0x4844b2]: do_syncrepl
/home/ly/Projects/openldap.git/servers/slapd/syncrepl.c:1539
===
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f9762ffe700 (LWP 29507)]D%D
test_filter (op=0x7f9762ffc210, e=0x7f96f19c37d8, f=0x20) at filterentry.c:69
69 if ( f->f_choice & SLAPD_FILTER_UNDEFINED ) {
(0) /opt/openldap.devel/libexec/slapd() [0x4430b7]: test_filter
/home/ly/Projects/openldap.git/servers/slapd/filterentry.c:69
(1) /opt/openldap.devel/libexec/slapd() [0x515081]: syncprov_matchops
/home/ly/Projects/openldap.git/servers/slapd/overlays/syncprov.c:1317
(2) /opt/openldap.devel/libexec/slapd() [0x515f43]: syncprov_op_response
/home/ly/Projects/openldap.git/servers/slapd/overlays/syncprov.c:1941
(3) /opt/openldap.devel/libexec/slapd() [0x434163]: slap_response_play
/home/ly/Projects/openldap.git/servers/slapd/result.c:509
(4) /opt/openldap.devel/libexec/slapd() [0x4346ca]: send_ldap_response
/home/ly/Projects/openldap.git/servers/slapd/result.c:584
(5) /opt/openldap.devel/libexec/slapd() [0x435062]: slap_send_ldap_result
/home/ly/Projects/openldap.git/servers/slapd/result.c:861
(6) /opt/openldap.devel/libexec/slapd() [0x4cb2e9]: mdb_add
/home/ly/Projects/openldap.git/servers/slapd/back-mdb/add.c:434
(7) /opt/openldap.devel/libexec/slapd() [0x48b506]: overlay_op_walk
/home/ly/Projects/openldap.git/servers/slapd/backover.c:674
(8) /opt/openldap.devel/libexec/slapd() [0x48b671]: over_op_func
/home/ly%Projojects/openldap.git/servers/slapd/backover.c:724
8 years, 4 months