I was able to get 2.4.40 compiled and installed.  Having the same issue.. here is the syslog output... you can see the timestamp difference between where the hang happens, and where slapd finally disconnects.

Oct 21 20:51:24 LDAP02 slapd[28955]: => send_search_entry: conn 1001 dn="cn=TEST,ou=Support,ou=Users,ou=Staff,dc=domain,dc=com"
Oct 21 20:51:24 LDAP02 slapd[28955]: <= send_search_entry: conn 1001 exit.
Oct 21 20:51:24 LDAP02 slapd[28955]: => send_search_reference: dn="(null)"
Oct 21 20:51:24 LDAP02 slapd[28955]: <= send_search_reference
Oct 21 20:51:25 LDAP02 slapd[28955]: => send_search_reference: dn="(null)"
Oct 21 20:51:25 LDAP02 slapd[28955]: <= send_search_reference
Oct 21 20:53:32 LDAP02 slapd[28955]: => send_search_reference: dn="(null)"
Oct 21 20:53:32 LDAP02 slapd[28955]: <= send_search_reference
Oct 21 20:53:32 LDAP02 slapd[28955]: send_ldap_result: conn=1001 op=1 p=3
Oct 21 20:53:32 LDAP02 slapd[28955]: send_ldap_response: msgid=2 tag=101 err=0
Oct 21 20:53:32 LDAP02 slapd[28955]: connection_get(12): got connid=1001
Oct 21 20:53:32 LDAP02 slapd[28955]: connection_read(12): checking for input on id=1001
Oct 21 20:53:32 LDAP02 slapd[28955]: op tag 0x42, time 1413950012
Oct 21 20:53:32 LDAP02 slapd[28955]: ber_get_next on fd 12 failed errno=0 (Success)
Oct 21 20:53:32 LDAP02 slapd[28955]: conn=1001 op=2 do_unbind
Oct 21 20:53:32 LDAP02 slapd[28955]: connection_close: conn=1001 sd=12
Oct 21 20:53:32 LDAP02 slapd[28955]: =>ldap_back_conn_destroy: fetching conn 1001
Oct 21 20:53:32 LDAP02 slapd[28955]: =>ldap_back_conn_destroy: destroying conn 1001 refcnt=0 flags=0x00000101

Any ideas?


From: jeflebo@outlook.com
To: quanah@zimbra.com; openldap-technical@openldap.org
Subject: RE: LDAP searches hang after returning results...
Date: Tue, 21 Oct 2014 19:39:45 -0700

Unfortunately just dealing with what was handed to me.  I'll try and get a new version compiled and see if that resolves this issue.

> Date: Tue, 21 Oct 2014 18:21:56 -0700
> From: quanah@zimbra.com
> To: jeflebo@outlook.com; openldap-technical@openldap.org
> Subject: RE: LDAP searches hang after returning results...
>
> --On Tuesday, October 21, 2014 6:27 PM -0700 Jeff Lebo
> <jeflebo@outlook.com> wrote:
>
> >
> > 2.4.31
>
> Why are you wasting everyone's time, but most importantly your own time,
> using something so ancient?
>
> <http://www.openldap.org/software/release/changes.html>
>
> Install a current release (2.4.40), and then see what issues you hit.
>
> --Quanah
>
>
> --
>
> Quanah Gibson-Mount
> Server Architect
> Zimbra, Inc.
> --------------------
> Zimbra :: the leader in open source messaging and collaboration
>