summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@kiki.usersys.redhat.com>2009-07-05 14:49:41 -0700
committerNoriko Hosoi <nhosoi@kiki.usersys.redhat.com>2009-07-05 14:49:41 -0700
commit3116dbec570b65d2d0a1df5bd000f6e63439e8ee (patch)
treebcf0a54a3364e688e2a8820b9127af485d70104b
parentfe97a63dcd53bedf7b06435f32630f419da1be79 (diff)
downloadds-3116dbec570b65d2d0a1df5bd000f6e63439e8ee.tar.gz
ds-3116dbec570b65d2d0a1df5bd000f6e63439e8ee.tar.xz
ds-3116dbec570b65d2d0a1df5bd000f6e63439e8ee.zip
509269 Simple paged result crashes/hangs the server
1) Commit 281f14adb012a54d8b10c9d51dbce6f5c6f3e549 was based on the wrong observation and testing. Backing off the change. 2) Search result set is retrieved from pblock and used for simple paged results. When the search result set is released, the address stashed in pblock should have been set NULL not to access the address again.
-rw-r--r--ldap/servers/slapd/back-ldbm/ldbm_search.c14
-rw-r--r--ldap/servers/slapd/conntable.c2
2 files changed, 10 insertions, 6 deletions
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c
index 8d57ae49..37a29ce7 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_search.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c
@@ -124,6 +124,7 @@ int ldbm_back_search_cleanup(Slapi_PBlock *pb, struct ldbminfo *li, sort_spec_th
if ( (NULL != sr) && (function_result != 0) ) {
/* in case paged results, clean up the conn */
pagedresults_set_search_result(pb->pb_conn, NULL);
+ slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET, NULL );
delete_search_result_set(&sr);
}
}
@@ -1138,11 +1139,12 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension )
{
/* in case paged results, clean up the conn */
pagedresults_set_search_result(pb->pb_conn, NULL);
- delete_search_result_set( &sr );
+ slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET, NULL );
if ( use_extension ) {
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY_EXT, NULL );
}
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY, NULL );
+ delete_search_result_set( &sr );
rc = SLAPI_FAIL_GENERAL;
goto bail;
}
@@ -1154,11 +1156,12 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension )
slapi_send_ldap_result( pb, LDAP_TIMELIMIT_EXCEEDED, NULL, NULL, nentries, urls );
/* in case paged results, clean up the conn */
pagedresults_set_search_result(pb->pb_conn, NULL);
- delete_search_result_set( &sr );
+ slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET, NULL );
if ( use_extension ) {
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY_EXT, NULL );
}
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY, NULL );
+ delete_search_result_set( &sr );
rc = SLAPI_FAIL_GENERAL;
goto bail;
}
@@ -1169,11 +1172,12 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension )
slapi_send_ldap_result( pb, LDAP_ADMINLIMIT_EXCEEDED, NULL, NULL, nentries, urls );
/* in case paged results, clean up the conn */
pagedresults_set_search_result(pb->pb_conn, NULL);
- delete_search_result_set( &sr );
+ slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET, NULL );
if ( use_extension ) {
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY_EXT, NULL );
}
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY, NULL );
+ delete_search_result_set( &sr );
rc = SLAPI_FAIL_GENERAL;
goto bail;
}
@@ -1186,11 +1190,12 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension )
/* destroy back_search_result_set */
/* in case paged results, clean up the conn */
pagedresults_set_search_result(pb->pb_conn, NULL);
- delete_search_result_set( &sr );
+ slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET, NULL );
if ( use_extension ) {
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY_EXT, NULL );
}
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY, NULL );
+ delete_search_result_set( &sr );
rc = 0;
goto bail;
}
@@ -1326,6 +1331,7 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension )
cache_return( &inst->inst_cache, &e );
/* in case paged results, clean up the conn */
pagedresults_set_search_result(pb->pb_conn, NULL);
+ slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET, NULL );
delete_search_result_set( &sr );
slapi_send_ldap_result( pb, LDAP_SIZELIMIT_EXCEEDED, NULL, NULL, nentries, urls );
rc = SLAPI_FAIL_GENERAL;
diff --git a/ldap/servers/slapd/conntable.c b/ldap/servers/slapd/conntable.c
index f4b529aa..3a0a86ce 100644
--- a/ldap/servers/slapd/conntable.c
+++ b/ldap/servers/slapd/conntable.c
@@ -312,9 +312,7 @@ connection_table_move_connection_out_of_active_list(Connection_Table *ct,Connect
connection_release_nolock (c);
- PR_Lock(c->c_mutex);
connection_cleanup (c);
- PR_Unlock(c->c_mutex);
PR_Unlock(ct->table_mutex);