Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
In uldap_connection_unbind, apr_ldap_rebind_remove() is always passed
NULL since ldc->ldap is either NULL on entry or is set to NULL.
This thread is expensive as apr_ldap_rebind_remove() acquires a mutex and iterates a linked list
trying to find a rebind reference matching NULL
~~~
173: while ((tmp_xref) && (tmp_xref->index != ld)) {
174: prev = tmp_xref;
175: tmp_xref = tmp_xref->next;
176: }
173 while ((tmp_xref) && (tmp_xref->index != ld)) {
**(gdb) p ld
$1 = (LDAP *) 0x0**
(gdb) p tmp_xref
$2 = (apr_ldap_rebind_entry_t *) 0x7f256418eea0
(gdb) p tmp_xref->index
$3 = (LDAP *) 0x7f254c00b2c0
(gdb) p tmp_xref->next
$4 = (struct apr_ldap_rebind_entry *) 0x7f256418eea0
(gdb) n
175 tmp_xref = tmp_xref->next;
(gdb) n
173 while ((tmp_xref) && (tmp_xref->index != ld)) {
(gdb) p tmp_xref
$5 = (apr_ldap_rebind_entry_t *) 0x7f256418eea0
(gdb)
~~~
http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ldap/util_ldap.c
~~~
static apr_status_t uldap_connection_unbind(void *param)
{
util_ldap_connection_t *ldc = param;
if (ldc) {
if (ldc->ldap) { # if not NULL
if (ldc->r) {
ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, ldc->r, "LDC %pp unbind", ldc);
}
ldap_unbind_s(ldc->ldap);
**ldc->ldap = NULL**; # Note the assignment
}
ldc->bound = 0;
/* forget the rebind info for this conn */
if (ldc->ChaseReferrals == AP_LDAP_CHASEREFERRALS_ON) { # if we get into this block,
**apr_ldap_rebind_remove(ldc->ldap)**; # <--- Passes NULL always
apr_pool_clear(ldc->rebind_pool);
}
}
return APR_SUCCESS;
}
~~~
LDAPReferrals Off is a workaround to avoid this loop.
Description of problem: In uldap_connection_unbind, apr_ldap_rebind_remove() is always passed NULL since ldc->ldap is either NULL on entry or is set to NULL. This thread is expensive as apr_ldap_rebind_remove() acquires a mutex and iterates a linked list trying to find a rebind reference matching NULL ~~~ 173: while ((tmp_xref) && (tmp_xref->index != ld)) { 174: prev = tmp_xref; 175: tmp_xref = tmp_xref->next; 176: } 173 while ((tmp_xref) && (tmp_xref->index != ld)) { **(gdb) p ld $1 = (LDAP *) 0x0** (gdb) p tmp_xref $2 = (apr_ldap_rebind_entry_t *) 0x7f256418eea0 (gdb) p tmp_xref->index $3 = (LDAP *) 0x7f254c00b2c0 (gdb) p tmp_xref->next $4 = (struct apr_ldap_rebind_entry *) 0x7f256418eea0 (gdb) n 175 tmp_xref = tmp_xref->next; (gdb) n 173 while ((tmp_xref) && (tmp_xref->index != ld)) { (gdb) p tmp_xref $5 = (apr_ldap_rebind_entry_t *) 0x7f256418eea0 (gdb) ~~~ http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ldap/util_ldap.c ~~~ static apr_status_t uldap_connection_unbind(void *param) { util_ldap_connection_t *ldc = param; if (ldc) { if (ldc->ldap) { # if not NULL if (ldc->r) { ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, ldc->r, "LDC %pp unbind", ldc); } ldap_unbind_s(ldc->ldap); **ldc->ldap = NULL**; # Note the assignment } ldc->bound = 0; /* forget the rebind info for this conn */ if (ldc->ChaseReferrals == AP_LDAP_CHASEREFERRALS_ON) { # if we get into this block, **apr_ldap_rebind_remove(ldc->ldap)**; # <--- Passes NULL always apr_pool_clear(ldc->rebind_pool); } } return APR_SUCCESS; } ~~~ LDAPReferrals Off is a workaround to avoid this loop.