more symbol binding problems

Sean McNeil sean at
Sun Jun 6 23:28:45 GMT 2004

I have another one that I can't explain.  apache2 and libphp4.

The php4 shared library that is pulled into apache2 has the following
(with pthread mapped to libc_r):

/usr/local/libexec/apache2/ => /lib/ (0x200aed000) => /usr/local/lib/ (0x200c07000) => /usr/local/lib/
(0x200d18000) => /usr/local/lib/ (0x200ee2000) => /usr/local/lib/ (0x20101c000) => /usr/local/lib/ (0x201270000) => /usr/local/lib/ (0x201393000) =>
/usr/local/lib/mysql/ (0x2014b3000) => /usr/local/lib/ (0x2015dc000) => /usr/local/lib/ (0x2016f6000) => /usr/local/lib/ (0x20182f000) => /usr/local/lib/ (0x201937000) => /usr/local/lib/ (0x201a6f000) => /usr/lib/ (0x201b7d000) => /usr/local/lib/ (0x201c85000) => /lib/ (0x201d8f000) => /lib/ (0x201e9e000) => /usr/local/lib/ (0x201fbf000) => /usr/local/lib/ (0x2021db000) => /usr/local/lib/ (0x2023cb000) => /usr/lib/ (0x202538000) => /lib/ (0x202672000) => /usr/lib/ (0x2027c5000) => /usr/local/lib/ (0x2028f0000) => /lib/ (0x20062a000)

When I use the ldap account manager package (lam), it causes the httpd
process to get stuck in a busy-loop eating 1/2 the cpu as:

(gdb) bt
#0  0x00000002014fcd4e in select () from /lib/
#1  0x0000000200c4532e in ldap_int_select (ld=0x8c8c00, timeout=0x0)
    at os-ip.c:733
#2  0x0000000200c34459 in wait4msg (ld=0x8c8c00, msgid=1, all=1,
    result=0x7fffffff9c38) at result.c:312
#3  0x0000000200c33fe7 in ldap_result (ld=0x8c8c00, msgid=1, all=1,
    timeout=0x0, result=0x7fffffff9c38) at result.c:113
#4  0x0000000200c376d4 in ldap_extended_operation_s (ld=0x8c8c00,
    reqoid=0x200c55134 "", reqdata=0x0,
    cctrls=0x0, retoidp=0x7fffffff9c90, retdatap=0x7fffffff9c98)
    at extended.c:138
#5  0x0000000200c4f606 in ldap_start_tls_s (ld=0x8c8c00,
    clientctrls=0x0) at tls.c:1725
#6  0x0000000203bf7a62 in ?? () from
#7  0x0000000203cbfcd3 in ?? () from
#8  0x0000000203cbfec9 in ?? () from
#9  0x0000000203cb2a8a in ?? () from
#10 0x0000000203c8cbee in ?? () from
#11 0x0000000203cc4ca5 in ?? () from
#12 0x00000000004222ea in ap_run_handler (r=0x7ba090) at config.c:151
#13 0x0000000000422860 in ap_invoke_handler (r=0x7ba090) at config.c:358
#14 0x000000000041f973 in ap_process_request (r=0x7ba090) at
#15 0x000000000041b5bc in ap_process_http_connection (c=0x7b21b0)

I do not understand why it is calling select in  Shouldn't it
have called the one in libc_r?  With GLOBAL or LOCAL DAG this should
have been resolved via the weak symbol to __select, no?

The interesting thing here is that if I use libpthread for apache then
there are no problems.  Maybe not all that suprising, though, as there
is no real difference in the select with libpthread whereas libc_r has a
much more complex implementation.


More information about the freebsd-threads mailing list