Bug 46064 - apr_ldap_init call fails
Summary: apr_ldap_init call fails
Status: NEW
Alias: None
Product: APR
Classification: Unclassified
Component: APR-util (show other bugs)
Version: 1.3.4
Hardware: Other AIX
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-22 09:25 UTC by Christian BOITEL
Modified: 2008-10-27 01:09 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian BOITEL 2008-10-22 09:25:28 UTC
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 !
Comment 1 Christian BOITEL 2008-10-23 03:32:25 UTC
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.


Comment 2 Christian BOITEL 2008-10-27 01:09:20 UTC
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