Bug 51244 - Incorrect aprlib will be used for aprutil
Summary: Incorrect aprlib will be used for aprutil
Status: NEW
Alias: None
Product: APR
Classification: Unclassified
Component: APR-util (show other bugs)
Version: HEAD
Hardware: PC Linux
: P1 blocker with 1 vote (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL: https://funnygroupnames.xyz/
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-23 09:13 UTC by Krisztian Banhidy
Modified: 2020-05-20 20:14 UTC (History)
3 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Krisztian Banhidy 2011-05-23 09:13:06 UTC
When compileing APR 1.4.4 with APR-UTIL 1.3.11 incorrect path to apr-util will be used (system apr under /usr/lib64). this was reproduced with apr 1.4.5 aswell. Bug isnt present in APR 1.4.2

Compiling options:

APR:
./configure --prefix=$/pkg/apache/2.2.18/apr --enable-threads --enable-dso --enable-other-child

LD_LIBRARY_PATH is also set after compile:
export LD_LIBRARY_PATH=/pkg/products/apache/2.2.18/apr/lib

APR-UTIL:
./configure --prefix=/pkg/apache/2.2.18/apr-util --enable-util-dso --with-apr=/pkg/apache/2.2.18/apr --with-apr-iconv=../apr-iconv --with-ldap=ldap 

LDD apache after compile with 1.4.2:

[root@kbanhidy2 apache]# ldd /pkg/products/apache/2.2.18/bin/httpd
        libm.so.6 => /lib64/libm.so.6 (0x00002b6ed4ed8000)
        libaprutil-1.so.0 => /pkg/products/apache/2.2.18/apr-util/lib/libaprutil-1.so.0 (0x00002b6ed515b000)
        libexpat.so.0 => /lib64/libexpat.so.0 (0x00002b6ed537c000)
        libapr-1.so.0 => /pkg/products/apache/2.2.18/apr/lib/libapr-1.so.0 (0x00002b6ed559f000)
        libuuid.so.1 => /lib64/libuuid.so.1 (0x00002b6ed57cb000)
        librt.so.1 => /lib64/librt.so.1 (0x00002b6ed59cf000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002b6ed5bd9000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b6ed5e11000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002b6ed602c000)
        libc.so.6 => /lib64/libc.so.6 (0x00002b6ed6231000)
        /lib64/ld-linux-x86-64.so.2 (0x00002b6ed4cbb000)
Comment 1 Rainer Jung 2011-05-23 09:35:21 UTC
Can you please clarify:

- which piece of software "uses the wrong apr-util" (e.g. httpd?)
- how did you compile that software (configure line)
- what does ldd show for that software with and without setting LD_LIBRARY_PATH
- what does "objdump -p" show for that software, especially the entries "NEEDED" and "RPATH"

Regards,

Rainer
Comment 2 Krisztian Banhidy 2011-05-23 11:40:05 UTC
(In reply to comment #1)
> Can you please clarify:
> 
> - which piece of software "uses the wrong apr-util" (e.g. httpd?)
> - how did you compile that software (configure line)
> - what does ldd show for that software with and without setting LD_LIBRARY_PATH
> - what does "objdump -p" show for that software, especially the entries
> "NEEDED" and "RPATH"
> 
> Regards,
> 
> Rainer

objdump is:
[root@kbanhidy2 apache]# objdump -p /pkg/products/apache/2.2.18/bin/httpd

/pkg/products/apache/2.2.18/bin/httpd:     file format elf64-x86-64

Program Header:
    PHDR off    0x0000000000000040 vaddr 0x0000000000000040 paddr 0x0000000000000040 align 2**3
         filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags r-x
  INTERP off    0x0000000000000200 vaddr 0x0000000000000200 paddr 0x0000000000000200 align 2**0
         filesz 0x000000000000001c memsz 0x000000000000001c flags r--
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**21
         filesz 0x00000000000674ac memsz 0x00000000000674ac flags r-x
    LOAD off    0x0000000000068000 vaddr 0x0000000000268000 paddr 0x0000000000268000 align 2**21
         filesz 0x0000000000004b60 memsz 0x0000000000007f80 flags rw-
 DYNAMIC off    0x00000000000693f0 vaddr 0x00000000002693f0 paddr 0x00000000002693f0 align 2**3
         filesz 0x0000000000000230 memsz 0x0000000000000230 flags rw-
    NOTE off    0x000000000000021c vaddr 0x000000000000021c paddr 0x000000000000021c align 2**2
         filesz 0x0000000000000020 memsz 0x0000000000000020 flags r--
EH_FRAME off    0x00000000000609c8 vaddr 0x00000000000609c8 paddr 0x00000000000609c8 align 2**2
         filesz 0x0000000000001534 memsz 0x0000000000001534 flags r--
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-

Dynamic Section:
  NEEDED      libm.so.6
  NEEDED      libaprutil-1.so.0
  NEEDED      libexpat.so.0
  NEEDED      libapr-1.so.0
  NEEDED      libuuid.so.1
  NEEDED      librt.so.1
  NEEDED      libcrypt.so.1
  NEEDED      libpthread.so.0
  NEEDED      libdl.so.2
  NEEDED      libc.so.6
  RPATH       /pkg/products/apache/2.2.18/apr-util/lib:/usr/lib64:/pkg/products/apache/2.2.18/apr/lib
  INIT        0x25b10
  FINI        0x563d8
  GNU_HASH    0x240
  STRTAB      0x114b8
  SYMTAB      0x3400
  STRSZ       0x82f6
  SYMENT      0x18
  DEBUG       0x0
  PLTGOT      0x269880
  PLTRELSZ    0x1aa0
  PLTREL      0x7
  JMPREL      0x24070
  RELA        0x1aab8
  RELASZ      0x95b8
  RELAENT     0x18
  VERNEED     0x1aa68
  VERNEEDNUM  0x2
  VERSYM      0x197ae
  RELACOUNT   0x1ae

Version References:
  required from libpthread.so.0:
    0x09691a75 0x00 04 GLIBC_2.2.5
  required from libc.so.6:
    0x0d696913 0x00 03 GLIBC_2.3
    0x09691a75 0x00 02 GLIBC_2.2.5

[root@kbanhidy2 apache]# ldd /pkg/products/apache/2.2.18/bin/httpd
        libm.so.6 => /lib64/libm.so.6 (0x00002b00c162c000)
        libaprutil-1.so.0 => /pkg/products/apache/2.2.18/apr-util/lib/libaprutil-1.so.0 (0x00002b00c18af000)
        libexpat.so.0 => /lib64/libexpat.so.0 (0x00002b00c1ad0000)
        libapr-1.so.0 => /usr/lib64/libapr-1.so.0 (0x00002b00c1cf3000)
        libuuid.so.1 => /lib64/libuuid.so.1 (0x00002b00c1f1a000)
        librt.so.1 => /lib64/librt.so.1 (0x00002b00c211e000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002b00c2328000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b00c2560000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002b00c277b000)
        libc.so.6 => /lib64/libc.so.6 (0x00002b00c2980000)
        /lib64/ld-linux-x86-64.so.2 (0x00002b00c140f000)

When checking libaprutil-1.so I see following:

[root@kbanhidy2 apache]# objdump -p /pkg/products/apache/2.2.18/apr-util/lib/libaprutil-1.so

/pkg/products/apache/2.2.18/apr-util/lib/libaprutil-1.so:     file format elf64-x86-64

Program Header:
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**21
         filesz 0x000000000001f6e4 memsz 0x000000000001f6e4 flags r-x
    LOAD off    0x000000000001f6e8 vaddr 0x000000000021f6e8 paddr 0x000000000021f6e8 align 2**21
         filesz 0x0000000000000fc8 memsz 0x0000000000001090 flags rw-
 DYNAMIC off    0x000000000001fa18 vaddr 0x000000000021fa18 paddr 0x000000000021fa18 align 2**3
         filesz 0x0000000000000210 memsz 0x0000000000000210 flags rw-
EH_FRAME off    0x000000000001be34 vaddr 0x000000000001be34 paddr 0x000000000001be34 align 2**2
         filesz 0x0000000000000bec memsz 0x0000000000000bec flags r--
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-

Dynamic Section:
  NEEDED      libexpat.so.0
  NEEDED      libapr-1.so.0
  NEEDED      libuuid.so.1
  NEEDED      librt.so.1
  NEEDED      libcrypt.so.1
  NEEDED      libpthread.so.0
  NEEDED      libdl.so.2
  NEEDED      libc.so.6
  SONAME      libaprutil-1.so.0
  RPATH       /usr/lib64:/pkg/products/apache/2.2.18/apr/lib
  INIT        0x7dc8
  FINI        0x1a7c8
  GNU_HASH    0x158
  STRTAB      0x3570
  SYMTAB      0xb28
  STRSZ       0x2180
  SYMENT      0x18
  PLTGOT      0x21fcd0
  PLTRELSZ    0x1830
  PLTREL      0x7
  JMPREL      0x6598
  RELA        0x5ae8
  RELASZ      0xab0
  RELAENT     0x18
  VERNEED     0x5a78
  VERNEEDNUM  0x3
  VERSYM      0x56f0
  RELACOUNT   0x3c

Version References:
  required from libpthread.so.0:
    0x09691a75 0x00 05 GLIBC_2.2.5
  required from libcrypt.so.1:
    0x09691a75 0x00 04 GLIBC_2.2.5
  required from libc.so.6:
    0x0d696913 0x00 03 GLIBC_2.3
    0x09691a75 0x00 02 GLIBC_2.2.5

[root@kbanhidy2 apache]# ldd /pkg/products/apache/2.2.18/apr-util/lib/libaprutil-1.so
        libexpat.so.0 => /lib64/libexpat.so.0 (0x00002aea8f545000)
        libapr-1.so.0 => /usr/lib64/libapr-1.so.0 (0x00002aea8f767000)
        libuuid.so.1 => /lib64/libuuid.so.1 (0x00002aea8f98e000)
        librt.so.1 => /lib64/librt.so.1 (0x00002aea8fb93000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002aea8fd9c000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aea8ffd4000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002aea901f0000)
        libc.so.6 => /lib64/libc.so.6 (0x00002aea903f4000)
        /lib64/ld-linux-x86-64.so.2 (0x000000343be00000)

So hence problems with APR-UTIL.

Tested APR 1.4.2 with APR-UTIL 1.3.11 and 1.3.12, libapr-1.so is linked correctly.
Tested APR 1.4.4 with APR-UTIL 1.3.11 and 1.3.12, libapr-1.so is linked to /usr/lib64.
Tested APR 1.4.5 with APR-UTIL 1.3.11 libapr-1.so is linked to /usr/lib64.

LDD -s same when Ld_LIBRARY_PATH is set and same when not set.

apr compile
./configure --prefix=$home/$ver/apr --enable-threads --enable-dso --enable-other-child

apr-util compile
./configure --prefix=$home/$ver/apr-util --enable-util-dso --with-apr=$home/$ver/apr --with-apr-iconv=../apr-iconv --with-ldap=ldap --with-ldap-lib=/usr/lib --with-ldap-include=/usr/include/

httpd compile
./configure --prefix=$home/$ver --with-ldap --enable-pie --enable-modules=all --enable-MODULE=shared --enable-auth-anon --enable-auth-dbm --enable-auth-digest --enable-authnz-ldap --enable-cache --enable-cern-meta --enable-charset-lite --enable-dav --enable-dav-fs --enable-dav-lock --enable-deflate --enable-disk-cache --enable-expires --enable-ext-filter --enable-file-cache --enable-headers --enable-ldap --enable-logio --enable-mem-cache --enable-mime-magic --enable-isapi --enable-proxy --enable-proxy-ajp --enable-proxy-balancer --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-rewrite --enable-so --enable-speling --enable-unique-id --enable-usertrack --enable-vhost-alias --enable-suexec --enable-ssl=shared --enable-ssl --with-apr=$home/$ver/apr --with-ssl=$home/$ver/openssl --with-apr-util=$home/$ver/apr-util --with-mpm=prefork --enable-mods-shared=all --enable-security
Comment 3 Rainer Jung 2011-05-23 12:27:08 UTC
Thank you, that helps.

The problem is, that apr-util has /usr/lib64 in its RPATH before anything else. Since apr-util is loaded first, it will then retrieve its own dependencies including apr from the system lib path.

We need to investigate, why /usr/lib64 is in the RPATH, and why it comes first. Unfortunately I could not reproduce your problem. Thus more questions:

Can you please also provide the objdump output for the apr library?

Please also check, whether you find any indication of /usr/lib64 in build-1/apr_rules.mk or bin/apr-1-config or lib/libapr-1.la of the installed apr 1.4.5.

You might also have a look at config.log in the build directories of apr and apr-util.

Regards,

Rainer
Comment 4 Krisztian Banhidy 2011-05-23 14:15:53 UTC
objdump for libapr:
[root@kbanhidy2 apache]# objdump -p /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.so.0

/pkg/products/apache.test/2.2.18/apr/lib/libapr-1.so.0:     file format elf64-x86-64

Program Header:
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**21
         filesz 0x000000000002a72c memsz 0x000000000002a72c flags r-x
    LOAD off    0x000000000002a730 vaddr 0x000000000022a730 paddr 0x000000000022a730 align 2**21
         filesz 0x0000000000001128 memsz 0x0000000000001228 flags rw-
 DYNAMIC off    0x000000000002a8b0 vaddr 0x000000000022a8b0 paddr 0x000000000022a8b0 align 2**3
         filesz 0x00000000000001e0 memsz 0x00000000000001e0 flags rw-
EH_FRAME off    0x000000000002504c vaddr 0x000000000002504c paddr 0x000000000002504c align 2**2
         filesz 0x000000000000126c memsz 0x000000000000126c flags r--
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-

Dynamic Section:
  NEEDED      libuuid.so.1
  NEEDED      librt.so.1
  NEEDED      libcrypt.so.1
  NEEDED      libpthread.so.0
  NEEDED      libdl.so.2
  NEEDED      libc.so.6
  SONAME      libapr-1.so.0
  INIT        0xa9b0
  FINI        0x23b88
  GNU_HASH    0x158
  STRTAB      0x4e80
  SYMTAB      0xf08
  STRSZ       0x2c37
  SYMENT      0x18
  PLTGOT      0x22ab30
  PLTRELSZ    0x20b8
  PLTREL      0x7
  JMPREL      0x88f8
  RELA        0x80b8
  RELASZ      0x840
  RELAENT     0x18
  VERNEED     0x8008
  VERNEEDNUM  0x3
  VERSYM      0x7ab8
  RELACOUNT   0x44

Version References:
  required from libdl.so.2:
    0x09691a75 0x00 08 GLIBC_2.2.5
  required from libpthread.so.0:
    0x09691972 0x00 05 GLIBC_2.3.2
    0x09691a75 0x00 04 GLIBC_2.2.5
    0x0d696914 0x00 03 GLIBC_2.4
  required from libc.so.6:
    0x09691973 0x00 09 GLIBC_2.3.3
    0x0d696913 0x00 07 GLIBC_2.3
    0x09691972 0x00 06 GLIBC_2.3.2
    0x09691a75 0x00 02 GLIBC_2.2.5


I did a recompile and moved everthing under apache.test, but same script and parameters are used.

under apr source doing search:

[root@kbanhidy2 apr-1.4.5]# grep -R /usr/lib64/ .
[root@kbanhidy2 apr-1.4.5]# grep -R libapr* .
./libapr-1.la:# libapr-1.la - a libtool library file
./.libs/libapr-1.la:# libapr-1.la - a libtool library file
./.libs/libapr-1.lai:# libapr-1.la - a libtool library file
[root@kbanhidy2 apr-1.4.5]#


under apr-util doing search:

[root@kbanhidy2 apr-1.4.5]# grep -R /usr/lib64/ ../apr-util-1.3.11/
../apr-util-1.3.11/libaprutil-1.la:dependency_libs=' -L/usr/lib /usr/lib64/libexpat.la /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl'
../apr-util-1.3.11/.libs/libaprutil-1.la:dependency_libs=' -L/usr/lib /usr/lib64/libexpat.la /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl'
../apr-util-1.3.11/.libs/libaprutil-1.lai:dependency_libs=' -L/usr/lib /usr/lib64/libexpat.la /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl'
[root@kbanhidy2 apr-1.4.5]# grep -R libapr* ../apr-util-1.3.11/
../apr-util-1.3.11/Makefile:APRUTIL_LIBS = -lexpat /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl
../apr-util-1.3.11/config.status:S["APRUTIL_LIBS"]="-lexpat /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl"
../apr-util-1.3.11/config.status:S["APR_LIBS"]=" /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt  -lpthread -ldl"
../apr-util-1.3.11/libaprutil-1.la:dependency_libs=' -L/usr/lib /usr/lib64/libexpat.la /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl'
../apr-util-1.3.11/.libs/libaprutil-1.la:dependency_libs=' -L/usr/lib /usr/lib64/libexpat.la /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl'
../apr-util-1.3.11/.libs/libaprutil-1.lai:dependency_libs=' -L/usr/lib /usr/lib64/libexpat.la /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl'
../apr-util-1.3.11/config.log:APRUTIL_LIBS='-lexpat /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl'
../apr-util-1.3.11/config.log:APR_LIBS=' /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt  -lpthread -ldl'
../apr-util-1.3.11/test/Makefile:APRUTIL_LIBS = -lexpat /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl
[root@kbanhidy2 apr-1.4.5]#

looking at config.log for apr-util:
## ----------------- ##
## Output variables. ##
## ----------------- ##

APRUTIL_DOTTED_VERSION='1.3.11'
APRUTIL_EXPORT_LIBS='-lexpat'
APRUTIL_INCLUDES='-I/usr/include/'
APRUTIL_LDFLAGS='-L/usr/lib'
APRUTIL_LIBNAME='aprutil-${APRUTIL_MAJOR_VERSION}'
APRUTIL_LIBS='-lexpat /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl'
APRUTIL_MAJOR_VERSION='1'
APRUTIL_PRIV_INCLUDES='-I/tmp/tmp.ztkYfC3285/apr-util-1.3.11/include -I/tmp/tmp.ztkYfC3285/apr-util-1.3.11/include/private'
APR_BUILD_DIR='/pkg/products/apache.test/2.2.18/apr/build-1'
APR_ICONV_DIR=''
APR_INCLUDES=' -I/pkg/products/apache.test/2.2.18/apr/include/apr-1 '
APR_LIBS=' /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt  -lpthread -ldl'
APR_XML_DIR=''
APU_CONFIG_LOCATION='source'
APU_DSO_LIBDIR='${libdir}/apr-util-1'
APU_HAVE_MODULES='yes'
APU_LTVERSION='-version-info 3:11:3'
APU_MODULES='  ldap/apr_ldap.la'

see no errors exit is 0.

I only found one reference to lib64 in apr config.log

lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\) $/  {\"\1\", (lt_ptr) 0},/p'\'' -e '\''s/^[BCDEGRST] \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr) \&\2},/p'\'''
lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^. .* \(.*\)$/extern int \1;/p'\'''
lt_cv_sys_lib_dlsearch_path_spec='/lib /usr/lib /samba/arch/lib '
lt_cv_sys_lib_search_path_spec='/usr/lib/gcc/x86_64-redhat-linux/4.1.2 /usr/lib64 /lib64'
lt_cv_sys_max_cmd_len=98304
lt_lt_cv_prog_compiler_c_o='"yes"'
lt_lt_cv_prog_compiler_c_o_CXX='"yes"'


looking at installed folder:

[root@kbanhidy2 apr-1.4.5]# grep -R /usr/lib64 /pkg/products/apache.test/2.2.18/apr/
/pkg/products/apache.test/2.2.18/apr/build-1/libtool:sys_lib_search_path_spec="/usr/lib/gcc/x86_64-redhat-linux/4.1.2 /usr/lib64 /lib64"
/pkg/products/apache.test/2.2.18/apr/build-1/libtool:sys_lib_search_path_spec="/usr/lib/gcc/x86_64-redhat-linux/4.1.2 /usr/lib64 /lib64"
[root@kbanhidy2 apr-1.4.5]#

[root@kbanhidy2 apr-1.4.5]# ldd /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.so.0
        libuuid.so.1 => /lib64/libuuid.so.1 (0x00002aced1198000)
        librt.so.1 => /lib64/librt.so.1 (0x00002aced139c000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002aced15a5000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aced17de000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002aced19f9000)
        libc.so.6 => /lib64/libc.so.6 (0x00002aced1bfd000)
        /lib64/ld-linux-x86-64.so.2 (0x000000343be00000)


Regards
Krisztian
Comment 5 Rainer Jung 2011-05-23 14:25:40 UTC
Thanks again. Although the dependency on /usr/lib64 could also be give in one of the files as usr/lib, it seems it does not come from apr but instead apr-util.

You configure line gives /usr/lib as an explicit path to ldap, maybe there's a problem there. Would it be easy for you to recompile with giving the ldap flags (just to check, whether the /usr/lib64 entry in the RPATH in the apr util library file comes from that?

Would it be possible to provide a tarball with the complete build directory of your apr 1.4.5 and apr-util 1.3.11 for download?

Regards,

Rainer
Comment 6 Krisztian Banhidy 2011-05-24 07:02:08 UTC
Of course it is possible, compile has been done, I was guessing wou wanted a compile without ldap flags, since previously it was specified.

[root@kbanhidy2 apache]# ldd /tmp/bug51244/apr-util/lib/libaprutil-1.so
        libexpat.so.0 => /lib64/libexpat.so.0 (0x00002ad3b3fdd000)
        libapr-1.so.0 => /usr/lib64/libapr-1.so.0 (0x00002ad3b41ff000)
        libuuid.so.1 => /lib64/libuuid.so.1 (0x00002ad3b4426000)
        librt.so.1 => /lib64/librt.so.1 (0x00002ad3b462b000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002ad3b4834000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ad3b4a6c000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002ad3b4c88000)
        libc.so.6 => /lib64/libc.so.6 (0x00002ad3b4e8c000)
        /lib64/ld-linux-x86-64.so.2 (0x000000343be00000)

 1013  /tmp/krisz/apr-1.4.5/configure --prefix=/tmp/bug51244/apr --enable-threads --enable-dso --enable-other-child

 1017  /tmp/krisz/apr-util-1.3.11/configure --prefix=/tmp/bug51244/apr-util --enable-util-dso --with-apr=/tmp/bug51244/apr/

upload has been done:
https://www.transferbigfiles.com/c9044d75-48bb-421d-be15-187e00982877?rid=tKzgvtwxXgkgwp8ljw2dEw%3d%3d

momentarly only place I could upload it.
Comment 7 Krisztian Banhidy 2011-05-31 08:10:48 UTC
Any updates on bug?
Comment 8 tsteven4 2011-07-27 20:48:52 UTC
I believe /usr/lib64 is added to RPATH as a result of a search for libexpat, although I don't understand the details.  I think you can work around the issue by using the --with-expat=builtin option of configure for aprutil.
Comment 9 Matt 2011-09-07 12:10:17 UTC
(In reply to comment #8)
> by using the --with-expat=builtin option of configure for aprutil.

Thanks, solved it for me :)

Had the same problem: need to deploy two different apr-releases on the same server. It definetely is a -rpath issue. 

Solved this temporarily using LD_PRELOAD, because this variable is processed by ld.so before -rpath. LD_LIBRARY_PATH etc. has no effect, because of -rpath.
Comment 10 Krisztian Banhidy 2011-09-07 12:34:50 UTC
(In reply to comment #8)
> I believe /usr/lib64 is added to RPATH as a result of a search for libexpat,
> although I don't understand the details.  I think you can work around the issue
> by using the --with-expat=builtin option of configure for aprutil.

Hello,


According to our investigations, that didnt solve the problem.

The problem lies when adding support with ldap. While libldap is used before expat, it explicitly adds the -L/usr/lib  LDFLAG, and thus when arriving to expat, it finds the incorrect libexpat.

for some reason when using the --with-expat=builtin we get same behaviour.
Comment 11 Matt 2011-09-07 12:46:18 UTC
From my side: no explicit usage of ldap. Only use an own libiconv

My configure call that works:

./configure --prefix=%{TARGET_DIR} \
            --with-apr=%{TARGET_DIR}/bin/apr-1-config \
            --with-iconv=%{TARGET_DIR} \
            --with-expat=builtin
Comment 12 Matt 2011-09-07 12:49:39 UTC
Forgot: 
The configure call only produces a rpath-polluted libaprutil.sp if --with-expat=inbuilt is omitted
Comment 13 Krisztian Banhidy 2011-09-07 13:13:23 UTC
(In reply to comment #12)
> Forgot: 
> The configure call only produces a rpath-polluted libaprutil.sp if
> --with-expat=inbuilt is omitted

Currently our config options that have solved the problem:

./configure --disable-example --disable-version --enable-MODULE=shared --enable-auth-anon --enable-auth-dbm \
	--enable-auth-digest --enable-authnz-ldap --enable-cache --enable-cern-meta --enable-charset-lite --enable-dav \
	--enable-dav-fs --enable-dav-lock --enable-deflate --enable-disk-cache --enable-expires --enable-ext-filter \
	--enable-file-cache --enable-headers --enable-info --enable-isapi --enable-ldap --enable-logio --enable-log-config \
	--enable-log-forensic --enable-logio --enable-mem-cache --enable-mime-magic --enable-mods-shared=all --enable-modules=all \
	--enable-nonportable-atomics=yes --enable-pie --enable-proxy --enable-proxy-ajp --enable-proxy-balancer \
	--enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-rewrite --enable-security --enable-so \
	--enable-speling --enable-ssl=shared --enable-static-support --enable-substitute --enable-suexec --enable-unique-id \
	--enable-usertrack --enable-vhost-alias --prefix=$xxx/prefork --with-apr-util=$xxx/apr-util \
	--with-apr=$xxx/apr --with-ldap --with-mpm=prefork --with-pcre=$xxx/pcre --with-ssl=$xxx/openssl

Also we have included into the compile our own versions of the following applications:
Apache="2.2.19"
APR="1.4.2"
APR iconv="1.2.1"
APR Util=="1.3.9"
Openssl="1.0.0d"
Libiconv="1.13.1"
libxml2="2.7.8"
mod_secucrity2="2.5.13"
pcre="8.12"
mod_jk="1.2.31"
curl="7.21.6"
expat="2.0.1"
openldap="2.4.23"
krb5="1.9.1"
mod_kerb="5.4"
perl="5.10.1"
mod_perl="2.0.5"
php="5.3.6"
libjpeg="8c"
libpng="1.5.4"
icu="4_8_1"
mcrypt="2.5.7"
imap="2007f"
oci="11.2.0.2.0"
ocishort="11_2"

We have compiled all these as since our installation needs them on deployed systems.

Also expat compile is done before apr-util compile and the options for apr-util is:  

./configure --prefix=$xxx/apr-util --enable-util-dso --with-apr=$xxx/apr --with-apr-iconv=../apr-iconv \
	--with-ldap=ldap --with-ldap-lib=$xxx/ldap/lib --with-ldap-include=$xxx/ldap/include \
	--with-expat=$xxx/expat --without-pgsql --without-mysql --without-odbc --without-oracle --without-sqlite2 \
	--without-sqlite3 --without-berkeley-db --without-oracle --without-freetds

After these changes compile goes without error.
Comment 14 kirsche40 2012-12-20 16:09:14 UTC
This annoying issue still exists in v1.5.1. Here the tail from my try to build this mess:

/bin/sh /opt/eldk/powerpc/sysroots/powerpc-linux/usr/build-1/libtool --silent --mode=link  powerpc-linux-gcc -pthread  -m32 -mhard-float  --sysroot=/opt/eldk-5.1/powerpc/sysroots/powerpc-linux -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE  -m32 -mhard-float  --sysroot=/opt/eldk-5.1/powerpc/sysroots/powerpc-linux -I/home/jddev/czsensor-development/czsensor-libraries/apr-util-1.5.1/include -I/home/jddev/czsensor-development/czsensor-libraries/apr-util-1.5.1/include/private  -I/opt/eldk/powerpc/sysroots/powerpc-linux/usr/include/apr-1  -I/home/jddev/czsensor-development/czsensor-libraries/apr-util-1.5.1/xml/expat/lib  -version-info 5:1:5   --sysroot=/opt/eldk-5.1/powerpc/sysroots/powerpc-linux -o libaprutil-1.la -rpath /opt/eldk/powerpc/sysroots/powerpc-linux/usr/lib buckets/apr_brigade.lo buckets/apr_buckets.lo buckets/apr_buckets_alloc.lo buckets/apr_buckets_eos.lo buckets/apr_buckets_file.lo buckets/apr_buckets_flush.lo buckets/apr_buckets_heap.lo buckets/apr_buckets_mmap.lo buckets/apr_buckets_pipe.lo buckets/apr_buckets_pool.lo buckets/apr_buckets_refcount.lo buckets/apr_buckets_simple.lo buckets/apr_buckets_socket.lo crypto/apr_crypto.lo crypto/apr_md4.lo crypto/apr_md5.lo crypto/apr_passwd.lo crypto/apr_sha1.lo crypto/crypt_blowfish.lo crypto/getuuid.lo crypto/uuid.lo dbd/apr_dbd.lo dbm/apr_dbm.lo dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo dbm/sdbm/sdbm_lock.lo dbm/sdbm/sdbm_pair.lo encoding/apr_base64.lo hooks/apr_hooks.lo ldap/apr_ldap_stub.lo ldap/apr_ldap_url.lo memcache/apr_memcache.lo misc/apr_date.lo misc/apr_queue.lo misc/apr_reslist.lo misc/apr_rmm.lo misc/apr_thread_pool.lo misc/apu_dso.lo misc/apu_version.lo strmatch/apr_strmatch.lo uri/apr_uri.lo xlate/xlate.lo xml/apr_xml.lo    -luuid -lrt -lcrypt  -lpthread  /home/jddev/czsensor-development/czsensor-libraries/apr-util-1.5.1/xml/expat/libexpat.la              /opt/eldk/powerpc/sysroots/powerpc-linux/usr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread
/bin/grep: /usr/lib/libuuid.la: No such file or directory
/bin/sed: can't read /usr/lib/libuuid.la: No such file or directory
libtool: link: `/usr/lib/libuuid.la' is not a valid libtool archive
make[1]: *** [libaprutil-1.la] Error 1
make[1]: Leaving directory `/home/jddev/czsensor-development/czsensor-libraries/apr-util-1.5.1'
make: *** [all-recursive] Error 1


Searching for the library at the correct place in cross toolchanin gives the expected result:

~$ ls /opt/eldk/powerpc/sysroots/powerpc-linux/usr/lib/libuuid*
/opt/eldk/powerpc/sysroots/powerpc-linux/usr/lib/libuuid.a   /opt/eldk/powerpc/sysroots/powerpc-linux/usr/lib/libuuid.so    /opt/eldk/powerpc/sysroots/powerpc-linux/usr/lib/libuuid.so.1.2
/opt/eldk/powerpc/sysroots/powerpc-linux/usr/lib/libuuid.la  /opt/eldk/powerpc/sysroots/powerpc-linux/usr/lib/libuuid.so.1  /opt/eldk/powerpc/sysroots/powerpc-linux/usr/lib/libuuid.so.1.3.0


Obviously configure script does set the library paths incorrect and does ignore LDFLAGS.

Because this bug is rather old and apr-utils is still unusable on non-intel platform I set this issue to blocker and raise the importance level.
Comment 15 Mark 2020-04-19 10:34:17 UTC
(In reply to Krisztian Banhidy from comment #4)
> objdump for libapr:
> [root@kbanhidy2 apache]# objdump -p
> /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.so.0
> 
> /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.so.0:     file format
> elf64-x86-64
> 
> Program Header:
>     LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr
> 0x0000000000000000 align 2**21
>          filesz 0x000000000002a72c memsz 0x000000000002a72c flags r-x
>     LOAD off    0x000000000002a730 vaddr 0x000000000022a730 paddr
> 0x000000000022a730 align 2**21
>          filesz 0x0000000000001128 memsz 0x0000000000001228 flags rw-
>  DYNAMIC off    0x000000000002a8b0 vaddr 0x000000000022a8b0 paddr
> 0x000000000022a8b0 align 2**3
>          filesz 0x00000000000001e0 memsz 0x00000000000001e0 flags rw-
> EH_FRAME off    0x000000000002504c vaddr 0x000000000002504c paddr
> 0x000000000002504c align 2**2
>          filesz 0x000000000000126c memsz 0x000000000000126c flags r--
>    STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr
> 0x0000000000000000 align 2**3
>          filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-
> 
> Dynamic Section:
>   NEEDED      libuuid.so.1
>   NEEDED      librt.so.1
>   NEEDED      libcrypt.so.1
>   NEEDED      libpthread.so.0
>   NEEDED      libdl.so.2
>   NEEDED      libc.so.6
>   SONAME      libapr-1.so.0
>   INIT        0xa9b0
>   FINI        0x23b88
>   GNU_HASH    0x158
>   STRTAB      0x4e80
>   SYMTAB      0xf08
>   STRSZ       0x2c37
>   SYMENT      0x18
>   PLTGOT      0x22ab30
>   PLTRELSZ    0x20b8
>   PLTREL      0x7
>   JMPREL      0x88f8
>   RELA        0x80b8
>   RELASZ      0x840
>   RELAENT     0x18
>   VERNEED     0x8008
>   VERNEEDNUM  0x3
>   VERSYM      0x7ab8
>   RELACOUNT   0x44
> 
> Version References:
>   required from libdl.so.2:
>     0x09691a75 0x00 08 GLIBC_2.2.5
>   required from libpthread.so.0:
>     0x09691972 0x00 05 GLIBC_2.3.2
>     0x09691a75 0x00 04 GLIBC_2.2.5
>     0x0d696914 0x00 03 GLIBC_2.4
>   required from libc.so.6:
>     0x09691973 0x00 09 GLIBC_2.3.3
>     0x0d696913 0x00 07 GLIBC_2.3
>     0x09691972 0x00 06 GLIBC_2.3.2
>     0x09691a75 0x00 02 GLIBC_2.2.5
> 
> 
> I did a recompile and moved everthing under apache.test, but same script and
> parameters are used.
> 
> under apr source doing search:
> 
> [root@kbanhidy2 apr-1.4.5]# grep -R /usr/lib64/ .
> [root@kbanhidy2 apr-1.4.5]# grep -R libapr* .
> ./libapr-1.la:# libapr-1.la - a libtool library file
> ./.libs/libapr-1.la:# libapr-1.la - a libtool library file
> ./.libs/libapr-1.lai:# libapr-1.la - a libtool library file
> [root@kbanhidy2 apr-1.4.5]#
> 
> 
> under apr-util doing search:
> 
> [root@kbanhidy2 apr-1.4.5]# grep -R /usr/lib64/ ../apr-util-1.3.11/
> ../apr-util-1.3.11/libaprutil-1.la:dependency_libs=' -L/usr/lib
> /usr/lib64/libexpat.la /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la
> -luuid -lrt -lcrypt -lpthread -ldl'
> ../apr-util-1.3.11/.libs/libaprutil-1.la:dependency_libs=' -L/usr/lib
> /usr/lib64/libexpat.la /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la
> -luuid -lrt -lcrypt -lpthread -ldl'
> ../apr-util-1.3.11/.libs/libaprutil-1.lai:dependency_libs=' -L/usr/lib
> /usr/lib64/libexpat.la /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la
> -luuid -lrt -lcrypt -lpthread -ldl'
> [root@kbanhidy2 apr-1.4.5]# grep -R libapr* ../apr-util-1.3.11/
> ../apr-util-1.3.11/Makefile:APRUTIL_LIBS = -lexpat
> /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt
> -lpthread -ldl
> ../apr-util-1.3.11/config.status:S["APRUTIL_LIBS"]="-lexpat
> /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt
> -lpthread -ldl"
> ../apr-util-1.3.11/config.status:S["APR_LIBS"]="
> /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt 
> -lpthread -ldl"
> ../apr-util-1.3.11/libaprutil-1.la:dependency_libs=' -L/usr/lib
> /usr/lib64/libexpat.la /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la
> -luuid -lrt -lcrypt -lpthread -ldl'
> ../apr-util-1.3.11/.libs/libaprutil-1.la:dependency_libs=' -L/usr/lib
> /usr/lib64/libexpat.la /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la
> -luuid -lrt -lcrypt -lpthread -ldl'
> ../apr-util-1.3.11/.libs/libaprutil-1.lai:dependency_libs=' -L/usr/lib
> /usr/lib64/libexpat.la /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la
> -luuid -lrt -lcrypt -lpthread -ldl'
> ../apr-util-1.3.11/config.log:APRUTIL_LIBS='-lexpat
> /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt
> -lpthread -ldl'
> ../apr-util-1.3.11/config.log:APR_LIBS='
> /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt 
> -lpthread -ldl'
> ../apr-util-1.3.11/test/Makefile:APRUTIL_LIBS = -lexpat
> /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt -lcrypt
> -lpthread -ldl
> [root@kbanhidy2 apr-1.4.5]#
> 
> looking at config.log for apr-util:
> ## ----------------- ##
> ## Output variables. ##
> ## ----------------- ##
> 
> APRUTIL_DOTTED_VERSION='1.3.11'
> APRUTIL_EXPORT_LIBS='-lexpat'
> APRUTIL_INCLUDES='-I/usr/include/'
> APRUTIL_LDFLAGS='-L/usr/lib'
> APRUTIL_LIBNAME='aprutil-${APRUTIL_MAJOR_VERSION}'
> APRUTIL_LIBS='-lexpat /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la
> -luuid -lrt -lcrypt -lpthread -ldl'
> APRUTIL_MAJOR_VERSION='1'
> APRUTIL_PRIV_INCLUDES='-I/tmp/tmp.ztkYfC3285/apr-util-1.3.11/include
> -I/tmp/tmp.ztkYfC3285/apr-util-1.3.11/include/private'
> APR_BUILD_DIR='/pkg/products/apache.test/2.2.18/apr/build-1'
> APR_ICONV_DIR=''
> APR_INCLUDES=' -I/pkg/products/apache.test/2.2.18/apr/include/apr-1 '
> APR_LIBS=' /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.la -luuid -lrt
> -lcrypt  -lpthread -ldl'
> APR_XML_DIR=''
> APU_CONFIG_LOCATION='source'
> APU_DSO_LIBDIR='${libdir}/apr-util-1'
> APU_HAVE_MODULES='yes'
> APU_LTVERSION='-version-info 3:11:3'
> APU_MODULES='  ldap/apr_ldap.la'
> 
> see no errors exit is 0.
> 
> I only found one reference to lib64 in apr config.log
> 
> lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\) $/ 
> {\"\1\", (lt_ptr) 0},/p'\'' -e '\''s/^[BCDEGRST] \([^ ]*\) \([^ ]*\)$/ 
> {"\2", (lt_ptr) \&\2},/p'\'''
> lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^. .* \(.*\)$/extern int
> \1;/p'\'''
> lt_cv_sys_lib_dlsearch_path_spec='/lib /usr/lib /samba/arch/lib '
> lt_cv_sys_lib_search_path_spec='/usr/lib/gcc/x86_64-redhat-linux/4.1.2
> /usr/lib64 /lib64'
> lt_cv_sys_max_cmd_len=98304
> lt_lt_cv_prog_compiler_c_o='"yes"'
> lt_lt_cv_prog_compiler_c_o_CXX='"yes"'
> 
> 
> looking at installed folder:
> 
> [root@kbanhidy2 apr-1.4.5]# grep -R /usr/lib64
> /pkg/products/apache.test/2.2.18/apr/
> /pkg/products/apache.test/2.2.18/apr/build-1/libtool:
> sys_lib_search_path_spec="/usr/lib/gcc/x86_64-redhat-linux/4.1.2 /usr/lib64
> /lib64"
> /pkg/products/apache.test/2.2.18/apr/build-1/libtool:
> sys_lib_search_path_spec="/usr/lib/gcc/x86_64-redhat-linux/4.1.2 /usr/lib64
> /lib64"
> [root@kbanhidy2 apr-1.4.5]#
> 
> [root@kbanhidy2 apr-1.4.5]# ldd
> /pkg/products/apache.test/2.2.18/apr/lib/libapr-1.so.0
>         libuuid.so.1 => /lib64/libuuid.so.1 (0x00002aced1198000)
>         librt.so.1 => /lib64/librt.so.1 (0x00002aced139c000)
>         libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002aced15a5000)
>         libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aced17de000)
>         libdl.so.2 => /lib64/libdl.so.2 (0x00002aced19f9000)
>         libc.so.6 => /lib64/libc.so.6 (0x00002aced1bfd000)
>         /lib64/ld-linux-x86-64.so.2 (0x000000343be00000)
> 
> 
> Regards
> Krisztian

<a href="https://www.blogger.com/profile/03653996480070487601">Blogger Profile</a>