httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: Need Help Debugging Shared Library (
Date Fri, 07 May 2004 00:11:26 GMT
Steve Waltner wrote:

>> You may find some useful notes here:
>> There are for debugging mod_perl 2.0, but most of it applies to any 
>> other shared C library.
> Thanks for the information but it still doesn't seem to be working 
> correctly. If this is a topic that I should take over to a gdb mailing 
> list, let me know. I started with a clean unpack of the Apache 2.0.49 
> source tarball and configure it with the following command:
> ./configure --enable-maintainer-mode --with-ldap --enable-ldap 
> --enable-auth-ldap --prefix=/tmp/apache-test
> make
> make install
> cp /tmp/httpd.conf /tmp/apache-test/conf/httpd.conf

> (gdb) run -k start
> Starting program: /tmp/apache-test/bin/httpd -k start
> Breakpoint 1, mod_auth_ldap_parse_url (cmd=0xffbffb78, config=0xea998,
>     url=0xeaa80 "ldap://,o=LSI%20Logic?uid")
>     at mod_auth_ldap.c:702
> 702         result = apr_ldap_url_parse(url, &(urld));
> (gdb) info shared
> From        To          Syms Read   Shared Object Library
> 0xff3847f4  0xff3929d0  Yes         /tmp/apache-test/lib/
> 0xff20d5a0  0xff2cb564  Yes         /usr/lib/
> 0xff342638  0xff35aa48  Yes         /tmp/apache-test/lib/
> 0xff1c8064  0xff1dd4e4  Yes         /tmp/apache-test/lib/
> 0xff3104bc  0xff310634  Yes         /usr/lib/
> 0xff1a2494  0xff1a51b8  Yes         /usr/lib/
> 0xff171a40  0xff180f24  Yes         /usr/lib/
> 0xff1535e0  0xff1595a4  Yes         /usr/lib/
> 0xff0940f8  0xff10098c  Yes         /usr/lib/
> 0xff028ab8  0xff057134  Yes         /usr/lib/
> 0xff0039f4  0xff003ffc  Yes         /usr/lib/
> 0xff3b0704  0xff3b075c  Yes         /usr/lib/
> 0xfef1ca08  0xfef9f038  Yes         /usr/lib/
> 0xfefd04f4  0xfefd1510  Yes         /usr/lib/
> 0xfeee1a8c  0xfeee7dd4  Yes         /usr/lib/
> 0xfeec09a0  0xfeec2950  Yes         /usr/lib/
> 0xfeeb0420  0xfeeb34e8  Yes         
> /usr/platform/SUNW,Ultra-Enterprise/lib/
> 0xfee873b0  0xfee96100  Yes         /usr/lib/
> (gdb) b apr_ldap_url.c:255
> No line 255 in file "apr_ldap_url.c".
> (gdb) b ldap_url_parse_ext
> Function "ldap_url_parse_ext" not defined.
> Make breakpoint pending on future shared library load? (y or [n])
> (gdb) quit
> The program is running.  Exit anyway? (y or n) y
> dumbo:/tmp/apache-test>
> =====================
> I haven't turned off the autoload shared libraries, so gdb does try to 
> load debug symbols from the libaprutil file, but it still appears as 
> though it's not working properly since I can't set a breakpoint in 
> apr_ldap_url.c or step into the function.
> Looking at the output of make, it appears as though the build process 
> does the needed debugging flags...


> make[3]: Entering directory `/tmp/httpd-2.0.49/srclib/apr-util'
> /bin/bash /tmp/httpd-2.0.49/srclib/apr/libtool --silent --mode=link gcc 
> -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes 
> encoding/apr_base64.lo hooks/apr_hooks.lo ldap/apr_ldap_compat.lo 
> ldap/apr_ldap_url.lo 

.lo gets linked alright, but it doesn't have any symbols:

httpd-2.0/srclib> nm apr-util/ldap/apr_ldap*o

The explanation comes from:


in apr_ldap_url.c and the header file apr_ldap_url.h:


#define apr_ldap_url_desc_t             LDAPURLDesc
#define apr_ldap_is_ldap_url(url)       ldap_is_ldap_url(url)
#define apr_ldap_is_ldaps_url(url)      ldap_is_ldaps_url(url)
#define apr_ldap_is_ldapi_url(url)      ldap_is_ldapi_url(url)
#define apr_ldap_url_parse(url, ludpp)  ldap_url_parse(url, ludpp)
#define apr_ldap_free_urldesc(ludp)     ldap_free_urldesc(ludp)

#else /* ! APR_HAS_LDAP_URL_PARSE */

So you have the implementation elsewhere. ldap_url_parse_ext doesn't exist at 
all. You  need to break at: ldap_url_parse or similar, I can't see 
ldap_url_parse_ext there.

Though I'm not sure who links against libldap (neither libaprutil nor httpd 
are linked against it on my machine), I will leave it here for you to discover 
that. ldd and nm, should help you to discover that.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message