Hi, If i use apr/apr-util 1.2.x, it works If i use apr/apr-util 1.3.x, function call fails Hints: => calls to apr_ldap_init return -1 => if i modify code of apr_ldap_init in ldap/apr_ldap_init.c to directly return -5, calls to apr_ldap_init still return -1 => if i modify code of apr_ldap_init in ldap/apr_ldap_stub.c to directly return -5, calls to apr_ldap_init do return -5 as expected Looks like the dso changes in 1.3.x are causing the failure !
I have recompiled apr-util-1.3.4 with --disable-util-dso configure options => apr_ldap_init calls are now fine I looked at the code and the only explanation hint i have is that calls to load_ldap function (in ldap/apr_ldap_stub.c) fail that is causing apr_ldap_init to always return -1. By the way, i found that in such cases that apr_ldap_init behaves differently in ldap/apr_ldap_stub.c than in ldap/apr_ldap_init.c => When the dso stub fails, the result_err argument isn't allocated as expected => in Apache/httpd, this is causing sigabort failures: httpd code checks the result_err returned; since it is null, it assumes that call succeeded which is wrong; when httpd tries to later use the connection, openldap sdk fails (assertion failed...) and generates a sigabort signal.
I have also opened an HTTPD bug to ensure Apache code also checks the apr_ldap_init return code instead of checking only the result parameter. See https://issues.apache.org/bugzilla/show_bug.cgi?id=46076